Forum Feature requests

Allow word break when a word is preceded by emdash aka em-dash aka long dash

Chris Thorman
Hi Mike --

In a book I'm working on, I found that Prince has non-standard word-wrapping behaviour when a long-dash (aka em-dash or emdash) precedes a word:

Example:

Chairman—Bob Smith; Vice Chairman—John Doe; Secretary—Henry Adams


Safari, Chrome, and even Microsoft Word, would be able to break this line as follows:

Chairman—Bob Smith; Vice Chairman—John Doe; Secretary—
Henry Adams


However, prince breaks it this way:

Chairman—Bob Smith; Vice Chairman—John Doe; 
Secretary—Henry Adams


I think that the breaking algorithm should be updated to recognize this case and be more consistent with standards of other agents and tools.

Meanwhile, the workaround, which was suggested elsewhere in these forums, I've included here for the benefit of others who stumble upon this post:

.breakablelongdash { /* add zero-width space after long-dashes to allow word breaks there. */
  prince-text-replace: '\2014' '\2014\200b'; 
}


An alternate workaround if you have an automated pipeline producing the HTML, is to do the above global replacement in the code that generates the HTML.

Thanks!

-c