FIXED: Use standard spaces for indentation in "Copy as HTML"
Posted: 28 Jul 2023 11:48
I just read an interesting article Is highlight.js Harmful for Your Site? and, convinced by author's arguments, I immediately embarked to find out if RJ TE can export code clips with highlighting. As it turned out, it... can
Of course! So far, so good, but when I exported it, saved and inspected in my browser, I noticed that whole indentation was gone.
It was gone, turns out, because it consisted of non-breaking spaces (ASCII 160) instead of standard spaces (ASCII 32), and I set my editor to remove these chars (Options > File > Miscellaneous > Remove any characters...) on save. Now, why would anybody need to use non-breaking spaces for indentation, if the whole clip is surrounded by <pre></pre> tags? Someone who wrote code for "Copy as HTML (black and white)"
realized this and used standard spaces. I believe they should be used in "Copy as HTML" as well.
And while I am at it: there's no need to surround indentation with <span></span>. Also "style" attribute value for <pre> tag instead of
could be just

It was gone, turns out, because it consisted of non-breaking spaces (ASCII 160) instead of standard spaces (ASCII 32), and I set my editor to remove these chars (Options > File > Miscellaneous > Remove any characters...) on save. Now, why would anybody need to use non-breaking spaces for indentation, if the whole clip is surrounded by <pre></pre> tags? Someone who wrote code for "Copy as HTML (black and white)"

And while I am at it: there's no need to surround indentation with <span></span>. Also "style" attribute value for <pre> tag instead of
Code: Select all
font-family: Fira Code;font-size: 12 pt;
Code: Select all
font-family: monospace;