budoux
budoux copied to clipboard
ZWSP / WBR insertion causes unintended space trimming on line breaks
When a ZWSP or WBR element appears at the end of a line in source HTML, the space that should be introduced by the line break may be removed. The behavior may vary by browser. Possible solution from the BudouX side is not to insert a separator right before \n.
Demo: https://codepen.io/tushuhei/pen/GRbraYN
HTML:
<p>
これは
<b>テスト</b>
です。
</p>
<p class="zwsp" style="word-break: keep-all; overflow-wrap: anywhere;">
これは​
<b>テスト</b>
です。​
</p>
<p class="wbr" style="word-break: keep-all; overflow-wrap: anywhere;">
これは<wbr>
<b>テスト</b>
です。<wbr>
</p>
This is the rendering of the test case in each browser. cc @kojiishi