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.

U+2005 etc. is (sometimes) stripped from html

See original GitHub issue

Prettier 1.19.1 Playground link

# Options (if any):
--single-quote

Input:

<p><span>X</span>   or   <span>Y</span></p>
<p>X   or   Y</p>

Output:

<p><span>X</span> or <span>Y</span></p>
<p>X   or   Y</p>

Expected behavior:

U+2005 should not be turned into a regular space.

From a quick test, this also happens for similar characters in the Unicode General Punctuation block.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
fiskercommented, Apr 23, 2020

I think I fixed it

$ node -p "require('prettier').format('<i /> \u2005 | \u2005 <i />', {parser:'html'}) === '<i /> \u2005 | \u2005 <i />\n'"
false

$ node -p "require('.').format('<i /> \u2005 | \u2005 <i />', {parser:'html'}) === '<i /> \u2005 | \u2005 <i />\n'"
true

minimal reproduction

"<i /> \u2005 | \u2005 <i />"
2reactions
fiskercommented, Apr 23, 2020

Found the problem, thank you.

$ node -p "require('prettier').format('<i>X</i>\u0020\u2005\u0020<i>X</i>', {parser:'html'}) === '<i>X</i>\u0020\u2005\u0020<i>X</i>\n'"
false
Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Functions - Google Groups
</html>. This fails in IE, Safari (although, fixed in webkit nightlies) and Chrome. A workaround is, of course, simple: var strip = (function(){...
Read more >
Documentation — feedparser 5.0.1 documentation
filename=”basic-existence.html”. Feeds in the real world may be missing elements, even elements that are required by the specification. You should always ...
Read more >
KOMMUNIKÁCIÓ, MÉDIA, GAZDASÁG
February 28, 2013, from www.telphoto.com/Rwanda_History.html ... teachers, priests, etc., whereas today “most stories are often told most.
Read more >
Package 'pls'
If stripped is TRUE, only the components coefficients, Xmeans, Ymeans and gammas are re- turned. Author(s). Kristian Hovde Liland. References. Indahl, U. (2005) ......
Read more >
DAMPNESS AND MOULD - WHO/Europe
study of asthma in the West Bank and Gaza Strip, ... significantly less often than those who lived in council houses or rented...
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