You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the output no longer contains the <var>. I think in general it's good to be able to call attention to certain things typographically inside examples even if you couldn't type them that way in a text editor, e.g. <var>, <mark>, <ins>, <del>, etc.
The text was updated successfully, but these errors were encountered:
They are getting removed as I am currently passing innerText of the code block to hljs. I attempted simply changing this to innerHTML but hljs escapes any html elements in the incoming source text. I can't blindly unescape as some of the escapes are potentially added by hjls itself. Probably innerHTML is the right choice here anyway.
This came up in some other context recently and it seems like a hard problem in general. I'm not sure any syntax highlighters properly account for the kind of work necessary, which would involve something like processing the text node-by-node. If you run across one let me know.
Will do. In the meantime I am going to use innerHTML so at least the elements won't mysteriously disappear. Also seems handy for samples that include html tags as you don't need to escape them.
the output no longer contains the
<var>
. I think in general it's good to be able to call attention to certain things typographically inside examples even if you couldn't type them that way in a text editor, e.g.<var>
,<mark>
,<ins>
,<del>
, etc.The text was updated successfully, but these errors were encountered: