From ee5d181c5050e6d429a48c6c273b7f5aa5b81300 Mon Sep 17 00:00:00 2001 From: Shuhei Iitsuka Date: Thu, 28 Nov 2024 14:02:31 +0900 Subject: [PATCH 1/2] Add notes on Web Components --- javascript/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/javascript/README.md b/javascript/README.md index bae96238..74c4e637 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -177,6 +177,8 @@ 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 component 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. From 6bd50bd86246919abb28e90f9e9ed6fcc7f39674 Mon Sep 17 00:00:00 2001 From: Shuhei Iitsuka Date: Thu, 28 Nov 2024 14:08:18 +0900 Subject: [PATCH 2/2] Update README.md --- javascript/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/javascript/README.md b/javascript/README.md index 74c4e637..277e00fc 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -177,7 +177,19 @@ 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 component 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. +**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