The discussion revolves around replacing text with custom HTML in Discourse. Shauny wants to replace tone indicators with HTML that includes a title tag explaining what it means and a link to the list.
Initially, zogstrip suggests using Watched Words to achieve this, but MarcP points out that Markdown & HTML do not work with Watched Words.
Akshine provides an alternative solution using two theme components, with the second one being a custom solution that uses a tooltip component to allow HTML. Shauny finds this solution promising but encounters two issues: the URL not working and the popup not displaying on mobile.
Akshine helps troubleshoot these issues, providing updates to the component. However, the solution requires a recent Discourse feature, and Shauny is hesitant to upgrade from the stable release. Akshine offers to explore a workaround, and zogstrip mentions a potential fix in a GitHub pull request.
I know you can easily set it to replace text with links, but I’d like to replace text with some custom HTML that will highlight and underline some text and include “title” tags.
The reason some people on our forums use tone indicators, but for new people they need explaining a lot. If I could have an abbr tag wrapped around them with a title tag explaining what it means and a link to the list, that would be perfect.
Is this possible? Would it require a theme component? I have no idea how to make one of those.
You could setup Watched Words to automatically replace those tone indicators with an <a href=“ https://toneindicators.carrd.co/#masterlist”><abbr title=“Joking”>/j</abbr></a> for example?
Yes that’s better thanks, long pressing does work. I do wonder if it’s possible to have it work with normal taps though as I don’t know if people would figure that out on their own!
Actually, it works. I tested it on a production Discourse instance with a mobile, but it relies on a feature introduced recently (3 weeks ago, #23071). You will have to upgrade your Discourse to make it work.