Open janko opened 4 years ago
Indeed, this is where an empty string value gets converted into a space (because an empty string is falsy), which then gets converted into
:
Thanks for the report!
I'm using
highlights
as a library outside of Atom. It works great, except that I noticed that in certain cases it adds trailing<span> </span>
at the end of lines.
Just to mention up front, with our current resources we're specifically not prioritizing issues that aren't causing a problem in Atom. To clarify, is this behavior causing a particular issue in Atom?
Not that I know of, I don't use Atom, I've only experienced it when using the library standalone.
Prerequisites
Description
I'm using
highlights
as a library outside of Atom. It works great, except that I noticed that in certain cases it adds trailing<span> </span>
at the end of lines.This is not a problem visually, but when developers are copy-pasting code into their editors, the trailing whitespace will get pasted as well.
Steps to Reproduce
Run the following script:
Expected behavior:
I expect only whitespace to be translated into
.Actual behavior:
Additional trailing
character is added after the# or :jsonb
comment:I believe this is because
highlights
converts empty strings into
, we can see there is one extra empty string in the list of tokens:Reproduces how often:
Every time.
Versions
Highlights 3.1.4