8000 Add notes on Web Components by tushuhei · Pull Request #831 · google/budoux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add notes on Web Components #831

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

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ import 'budoux/module/webcomponents/budoux-zh-hant';
import 'budoux/module/webcomponents/budoux-th';
```

**Note:** BudouX Web Components directly manipulate the input HTML content
instead of outputting the result to a shadow DOM. This design was chosen because
the goal of BudouX Web Components is to simply insert zero-width spaces (ZWSPs)
into the content, and isolating the style from the rest of the document could
introduce unexpected side effects for developers.

Consequently, cloning or editing the element might lead to duplicated ZWSPs
between phrases. This is because BudouX Web Components cannot distinguish
between characters that originate in the source and those that are inserted by
BudouX itself once connected to the document. Duplicating ZWSPs will not cause
any severe problems in controlling line breaks, and they are invisible anyway,
but this is the reason we do not support other separator characters for these
components.

### CLI

You can also format inputs on your terminal with `budoux` command.
Expand Down
0