maranget / hevea

Hevea is a fast latex to html translator
http://hevea.inria.fr
Other
97 stars 12 forks source link

[html] Do not use zero-width-joiner to implement non-breakable space. #61

Closed maranget closed 3 years ago

maranget commented 3 years ago

Some browsers (e.g. Firefox) render zwj poorly. Hence this alternative implementation of space that should not break as sequence of non-breaking spaces (U+2040) and narrow no-break spaces (U+202F).

This PR intends to solve issue #60.

maranget commented 3 years ago

@cspiel, @Octachron Hi, would you please comment on this PR? See also issue #60.

cspiel commented 3 years ago

THX, @maranget for the fix! I have run my all my old tests and your change looks perfect to me. The line-breaking behavior and the persistence of non-breakable spaces remains exactly the same even at the beginning of paragraphs.

Needless to say that I very much prefer fixing Hevea instead of every project that uses it as conversion engine.

maranget commented 3 years ago

@cspiel Thanks a lot for your comment. I'll merge this PR. Fixing the ocaml manual post-processing is another story.

sanette commented 3 years ago

@maranget I assume that in your original post you wanted to say U+2004 instead of U+2040 ? If I understand correctly, the sequence 2004 200D that appeared for instance in 'Chapter\u2004\u200d2\u2003The module system' will now be replaced by 2004 202F Could you confirm? thx!