You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,7 @@ tags or tag hierarchies.
15
15
16
16
The exports can be found in [`dist/htmldiff.d.ts`](https://github.com/Sedeniono/htmldiff.js/blob/master/dist/htmldiff.d.ts).
17
17
18
-
### `diff` function
19
-
18
+
The main exported function is:
20
19
```TS
21
20
function diff(before:string, after:string, className?:string, dataPrefix?:string);
22
21
```
@@ -36,8 +35,12 @@ of these parameters it will be ignored:
36
35
the default attribute name `data-operation-index` will be added on every inserted
37
36
`<ins>` and `<del>` tag. The value of this attribute is an auto incremented counter.
38
37
38
+
Note that for better support of languages that do not use spaces between words (e.g. Japanese),
39
+
the code relies on the [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) API, which is available in all major browsers since 2024.
40
+
If it is not available, the library falls back to separating words only by whitespace.
0 commit comments