Permit HTML VAR tags in messages?

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:

meta.discourse.org/u/<var>username</var>/notifications

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?

For that specific use case we already have https://meta.discourse.org/my/notifications

Understood, it was merely an example. If you prefer, take this one…

The list of posts with a given tag can be viewed at:

meta.discourse.org/tag/<var>tagname</var>

This might help

Then, you could make a theme component to add a button to the editor to wrap text more easily.

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?