Trailing text is not preserved
See original GitHub issueTo Reproduce
- Get sample project that demonstrates bug (2 files) from here: https://gist.github.com/IvanPizhenko/100c92f523a994fd425ff8f16420f12d
- Run
npm install
- Run
node index.js
Expected behavior
I expect trailing text Above
is preserved, i.e. sanitized output should be:
Below
<span>[image: image.png]</span>
Above
Describe the bug
Trailing text Above
is lost, i.e. I am getting:
Below
<span>[image: image.png]</span>
Details
Version of Node.js: v12.22.6
Server Operating System: Linux
Additional context:
I am trying to upgrade sanitize-html
from version 1.21.1
to latest 2.5.2
(at the moment of submitting this issue) and getting the above described issue. According to my research (I have tried multiple versions) bug has appeared in version 1.27.3
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Trailing Whitespace in Comments Not Preserved #17421
Actual behavior: Trailing white space is lost. ... A compiler option to preserve trailing white space within comments in the tsconfig.json would ...
Read more >Is there a simple way to preserve trailing tabs in java during ...
I'm not alone in trying to preserve whitespace am I? I have a problem with it when it's reading from a file. I...
Read more >Trailing Blanks in Character String Processing
Trailing blanks are not kept in many positions and that means that a text field literal containing one blank ' ' is often...
Read more >Re: [csswg-drafts] [css-text][css-sizing] When to/not to ... - Mailing lists
Re: [csswg-drafts] [css-text][css-sizing] When to/not to include preserved trailing spaces (#3440). This message : [ Message body ] [ Respond ] [ More ......
Read more >Keep trailing spaces in fields after Text To Columns
I am taking a text file which includes spaces in each. ... I would like a fix for all the cells as it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It sounds like it might be an upstream issue with the htmlparser2 module. Might be — haven’t delved into it.
Seems to be a regression. Maintainers: could you point us in the right direction as far as any guesses on where to look? We may attempt a fix.