asciidoctor-pdf: Break non-breaking hyphen

My test code:

Aaaa bbbbbb ccccccccc ddddd eeeeeeeee ffffffffffffff gggggggggggg hhhhhhh iiiiiii RFC{nbsp}P{nbsp}IEC{nbsp}60870‑5‑104

Render: 1

> asciidoctor --version
Asciidoctor 1.5.4 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]) (lc:IBM866 fs:Windows-1251 in:- ex:IBM866)

> asciidoctor-pdf --version
Asciidoctor PDF 1.5.0.alpha.11 using Asciidoctor 1.5.4 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]) (lc:IBM866 fs:Windows-1251 in:- ex:IBM866)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

\o/ 🍻

This is a permanent solution, but very specific to this use case. If something causes the hyphen to be isolated in a fragment by itself (for instance, if you try to bold it), then the line will break there. The general solution is to figure out why Prawn is allowing breaks at the boundaries of fragments, since fragments are merely an internal data structure that should have no bearing on line wrapping behavior. In other words, it’s a bug in Prawn.