The discussion revolves around allowing HTML <var> tags in Discourse messages. ferdnyc points out that these tags are currently stripped out, despite being a commonly accepted way to indicate text should not be taken literally. They provide examples of how <var> tags could be useful, such as in URLs with placeholder text.
Falco suggests alternative solutions for specific use cases, but ferdnyc emphasizes that these examples are merely illustrative and that the ability to use <var> tags would be more broadly useful.
Arkshine proposes using theme components to add custom styles, but ferdnyc argues that this approach would not work because the <var> tag itself is stripped out, leaving nothing to style. They note that while Markdown or custom styles could be used to achieve a similar visual effect, the semantic meaning of <var> tags is distinct and important, particularly for assistive technologies.
I notice that HTML VAR tags (<var>text</var>) aren’t included in the supported HTML for Discourse messages, so they’re stripped out when posting.
<var> is a commonly-accepted method of indicating that some part of the text is not to be taken literally. It’s often used in example strings. For instance, I might tell someone that they can view their notifications list by visiting this URL:
The default styling of most browsers would render the username portion in italics, to indicate that it’s meant to be replaced rather than copied verbatim.
But in Discourse, <var>username</var> becomes simply username, with the var tags stripped out. Any chance the very useful <var> tag could be added to the permitted-HTML list?
I could be wrong, but I don’t think that would work.
All of those techniques add style attributes to existing HTML elements, in the generated output. But, in the case of <var> the actual tag is stripped out of the generated HTML. So, there’s nothing to style.
I could add a span to style a bit of text with italics, sure… but I could just use MarkDown for that. It still wouldn’t be the same as wrapping the text in <var>…</var>. <var> is semantically different from merely italicizing text (even if it typically displays that way), particularly when it comes to devices that parse the actual page content, such as screen readers & other assistive technologies.
…Unless I’m misunderstanding the information from that post you linked to?