Page 1 of 1

FIXED: Use standard spaces for indentation in "Copy as HTML"

Posted: 28 Jul 2023 11:48
by pjj
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 8) 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)" 8) 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

Code: Select all

font-family: Fira Code;font-size: 12 pt;
could be just

Code: Select all

font-family: monospace;

Re: Use standard spaces for indentation in "Copy as HTML"

Posted: 08 Aug 2023 14:54
by Rickard Johansson
Done in next release (v15.92). Thanks!