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: docs/docs/fundamentals/core-concepts.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,24 +45,22 @@ sources.
45
45
:::
46
46
47
47
## Normalization
48
-
HTML can be messy. When users paste rich text from applications like Google Docs or Microsoft Word, the HTML often contains additional wrapper elements, inline styles, and structural quirks that may not match the HTML structure expected by the library.
49
48
50
-
To handle this, both components provide a `useHtmlNormalizer` prop that normalizes incoming HTML. The normalizer cleans and restructures the input into the predictable format the library expects (e.g. it maps `<strong>` to `<b>`, unwraps `<div>` containers into `<p>` tags, and strips unsupported tags). The `useHtmlNormalizer` prop defaults to `true`.
49
+
HTML can be messy. Whether users paste rich text from applications like Google Docs or Microsoft Word, or you inject external HTML via `defaultValue`, `setValue`, or pass it directly as `children` into `EnrichedText`, the markup often contains additional wrapper elements, inline styles, and structural quirks that may not match the HTML structure expected by the library..
50
+
51
+
To handle this, both components provide a `useHtmlNormalizer` prop that normalizes incoming HTML. The normalizer cleans and restructures the input into the predictable format the library relies on (e.g., it maps `<strong>` to `<b>`, unwraps `<div>` containers into `<p>` tags, and strips unsupported tags). The `useHtmlNormalizer` prop defaults to `true`.
52
+
51
53
All supported and canonical tags are listed in [Supported tags](/fundamentals/html-format-and-supported-tags).
52
54
53
-
## Two components, one styling API
55
+
## Two components, one HTML format
54
56
55
57
The library is split into an editor and a viewer:
56
58
57
59
-**`EnrichedTextInput`** — the interactive editor from the previous page.
58
60
-**`EnrichedText`** — a read-only display component that renders the input's
59
61
HTML.
60
62
61
-
Both accept the same `htmlStyle` prop, which describes how each tag looks
62
-
(heading sizes, blockquote borders, code block colors, and so on). Because they
63
-
share it, text looks identical whether it's being edited or displayed — no
64
-
drift between the two. A common setup edits in `EnrichedTextInput`, stores the
65
-
`getHTML` output, and later shows it with `EnrichedText`.
63
+
The HTML format that both components expect is identical, what allows you to integrate them seamlessly. A common setup edits in `EnrichedTextInput`, stores the `getHTML` output, and later displays it with `EnrichedText`.
0 commit comments