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.

Non breaking space rendered as unicode

See original GitHub issue

Hey - sorry but I’m not sure I understand why richtypo renders non breaking space in unicode \xA0 rather than html nbsp;? In my situation, I’m using element.innerHTML = richtypo.full(text) and unicode spaces are not rendered in html.

It seems like cleanup_after is responsible for this. I’ve forked the repo to make richtypo behave like I think it should (ie doing all transformations using unicode characters and substituting these characters with corresponding html entities after the whole process).

https://github.com/dbismut/richtypo.js

Obviously most of the tests fail 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dbismutcommented, Oct 12, 2018

Done: \xAF doesn’t actually render in HTML so I’ve kept  . I’ve also added French rules with a punctuation rules that adds thin spaces before :;!?» and after «.

0reactions
Grawlcommented, Mar 3, 2020

is that specific to Universal Vue

@dbismut looks like you’re right

Read more comments on GitHub >

github_iconTop Results From Across the Web

Non-breaking space - Wikipedia
Non-breaking space. In Unicode, U+00A0 NO-BREAK SPACE (  ,  ). See also. U+202F NARROW NO-BREAK SPACE.
Read more >
Non-Breaking Spaces and UTF-8 Madness | Big Mess o' Wires
The direct UTF-8 encoding for a non-breaking space (without using the   entity) is C2 80. Â is Unicode character U+00C2, Latin capital ......
Read more >
How to render narrow non-breaking spaces in HTML for ...
The only way for Unicode to correct it (for plain text documents only), was to add another character, namely U+202F (the NARROW NON-BREAKING ......
Read more >
How to Add a Non-breaking Space with the   Character ...
In HTML, you can't create an extra blank space after the space ( ) character with the spacebar. If you want 10 blank...
Read more >
What is A Non-Breaking Space (NBSP) and How is it Used?
A fixed space or hard space can be particularly useful when used inside HTML or Unicode tags. For instance: “ ”. Placing the...
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