I have some table headers which do not lay out well unless I explicitly provide word-break opportunities. For reasons, in our codebase we are generating these in two different ways: one via direct entry of U+200B characters in our UTF-8 source code (Python strings) and the other via `<wbr/>` elements in our HTML templates.
I notice that when rendered by Prince, the former ("raw" U+200B character) do encourage word breaks when necessary (e.g. in narrow table headings) but the latter (wbr element) have no effect. This seems like a bug to me?
My first workaround attempt turned out to be sufficient, simply adding to our CSS the following:
Makes the wbr elements behave in Prince as they did already in browsers and should according to MDN interpretation of HTML standard: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr#notes
It looks like a very similar workaround was already noted on the forums at https://www.princexml.com/forum/topic/9/css-for-nobr-and-wbr-elements but as a "tip" rather than a bug report.
I notice that when rendered by Prince, the former ("raw" U+200B character) do encourage word breaks when necessary (e.g. in narrow table headings) but the latter (wbr element) have no effect. This seems like a bug to me?
My first workaround attempt turned out to be sufficient, simply adding to our CSS the following:
wbr::after {
content: "\200B"; /* WORKAROUND: https://www.princexml.com/forum/topic/4810 */
}
Makes the wbr elements behave in Prince as they did already in browsers and should according to MDN interpretation of HTML standard: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr#notes
It looks like a very similar workaround was already noted on the forums at https://www.princexml.com/forum/topic/9/css-for-nobr-and-wbr-elements but as a "tip" rather than a bug report.
Edited by natevw