Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZWSP / WBR insertion causes unintended space trimming on line breaks #659

Open
tushuhei opened this issue Jul 31, 2024 · 1 comment
Open

Comments

@tushuhei
Copy link
Member

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;">
  これは&ZeroWidthSpace;
  <b>テスト</b>
  です。&ZeroWidthSpace;
</p>
<p class="wbr" style="word-break: keep-all; overflow-wrap: anywhere;">
  これは<wbr>
  <b>テスト</b>
  です。<wbr>
</p>
@tushuhei
Copy link
Member Author

tushuhei commented Aug 8, 2024

This is the rendering of the test case in each browser.
cc @kojiishi

budoux_render

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant