question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

removeLineBreaks causes inconsistency in text content spaces

See original GitHub issue

With the option removeLineBreaks: true in https://github.com/ndaidong/article-parser/blob/e0543954b4b00b5f7937a888754ebb395ed39d4a/src/utils/standalizeArticle.js#L39 the text spaces in many articles are replace with a line break \n. The words end up coming together (when not using a browser to display the result)

Here some screenshots examples with yarn eval ./test-data/regular-article.html

1. removeLineBreaks: true Captura de Tela 2022-03-25 às 01 27 09 Captura de Tela 2022-03-25 às 01 35 05

2. removeLineBreaks: false Captura de Tela 2022-03-25 às 01 28 46 Captura de Tela 2022-03-25 às 01 35 40

I think we can do improve the sanitizer

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
andremacolacommented, Mar 25, 2022

Are you going to make it happen on your own? I don’t know if I want to start

Yep, I can do that.

0reactions
SettingDustcommented, Mar 25, 2022

removeLineBreaks in my opinion default should be false like html-crush defaults. But it’s irrelevant if we have a way to customize with sanitizeHtmlOptions

The output won’t display to user. So it’s fine in my mind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Display: none" seems to remove line breaks in text elements ...
The problem: if I have content in a text element that is currently not being displayed and I save it to localstorage, when...
Read more >
Remove line breaks followed by space in text file
Is there a way to remove only those line endings followed by a space? I have quite a number of small files which...
Read more >
Remove extra whitespace caused by line break within a button
The word-break CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box.
Read more >
Line breaks are removed in posts made in plain text format
This causes the line breaks to be removed. Any two or more successive line breaks are not removed. Workaround. Use one of the...
Read more >
Why do emails created from Templates and Signatures ... - FYI
Issue The formatting of emails created from templates or signatures within FYI results in unnecessary line breaks or inconsistent fonts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found