From ff0fa2cc96a86bd82851f3f71dd17b112894e0d1 Mon Sep 17 00:00:00 2001 From: szydlovsky <9szydlowski9@gmail.com> Date: Tue, 7 Jul 2026 19:02:29 +0200 Subject: [PATCH 1/2] chore: useHtmlNormalizer enabled by default --- apps/example-web/src/App.tsx | 1 - apps/example-web/src/components/TextRenderer.tsx | 1 - apps/example/src/components/TextRenderer.tsx | 1 - apps/example/src/screens/DevScreen.tsx | 1 - apps/example/src/screens/EnrichedTextScreen.tsx | 1 - apps/example/src/screens/TestScreen.tsx | 1 - docs/INPUT_API_REFERENCE.md | 8 ++++---- docs/TEXT_API_REFERENCE.md | 2 +- src/native/EnrichedText.tsx | 2 +- src/types.ts | 4 ++-- src/utils/EnrichedTextInputDefaultProps.ts | 2 +- src/web/EnrichedText.tsx | 2 +- src/web/EnrichedTextInput.tsx | 2 +- 13 files changed, 11 insertions(+), 17 deletions(-) diff --git a/apps/example-web/src/App.tsx b/apps/example-web/src/App.tsx index 07cad4e33..f0c6639d5 100644 --- a/apps/example-web/src/App.tsx +++ b/apps/example-web/src/App.tsx @@ -280,7 +280,6 @@ function App() { mentionIndicators={['@', '#']} htmlStyle={WEB_DEFAULT_HTML_STYLE} linkRegex={LINK_REGEX} - useHtmlNormalizer /> diff --git a/apps/example/src/components/TextRenderer.tsx b/apps/example/src/components/TextRenderer.tsx index a8a3e4b9c..6fe302c46 100644 --- a/apps/example/src/components/TextRenderer.tsx +++ b/apps/example/src/components/TextRenderer.tsx @@ -35,7 +35,6 @@ export const TextRenderer = ({ nodes }: TextRendererProps) => { htmlStyle={enrichedTextHtmlStyle} onLinkPress={handleLinkPress} onMentionPress={handleMentionPress} - useHtmlNormalizer > {node} diff --git a/apps/example/src/screens/DevScreen.tsx b/apps/example/src/screens/DevScreen.tsx index 83d26c9aa..d5b4ba3f1 100644 --- a/apps/example/src/screens/DevScreen.tsx +++ b/apps/example/src/screens/DevScreen.tsx @@ -73,7 +73,6 @@ export function DevScreen({ onSwitch }: DevScreenProps) { ANDROID_EXPERIMENTAL_SYNCHRONOUS_EVENTS } onPasteImages={(e) => editor.handlePasteImagesEvent(e.nativeEvent)} - useHtmlNormalizer testID="editor-input" /> {html} diff --git a/apps/example/src/screens/TestScreen.tsx b/apps/example/src/screens/TestScreen.tsx index 4b9565cd2..77656b58e 100644 --- a/apps/example/src/screens/TestScreen.tsx +++ b/apps/example/src/screens/TestScreen.tsx @@ -95,7 +95,6 @@ export function TestScreen({ ANDROID_EXPERIMENTAL_SYNCHRONOUS_EVENTS } onPasteImages={(e) => editor.handlePasteImagesEvent(e.nativeEvent)} - useHtmlNormalizer testID="editor-input" /> [!NOTE] > Paragraph shortcuts are only effective on plain paragraphs. If the paragraph already has an active paragraph style (e.g. it is already a heading or a list item), typing the trigger pattern has no effect. @@ -639,13 +639,13 @@ If true, Android will use experimental synchronous events. This will prevent fro | ------ | ------------- | -------- | | `bool` | `false` | Android | -### `useHtmlNormalizer` - EXPERIMENTAL +### `useHtmlNormalizer` -If true, external HTML pasted/inserted into the input (e.g. from Google Docs, Word, or web pages) will be normalized into the canonical tag subset that the enriched parser understands. However, this is an experimental feature, which has not been thoroughly tested. We may decide to enable it by default in a future release. +If true, external HTML pasted/inserted into the input (e.g. from Google Docs, Word, or web pages) will be normalized into the canonical tag subset that the enriched parser understands. | Type | Default Value | Platform | | ------ | ------------- | ----------------- | -| `bool` | `false` | iOS, Android, Web | +| `bool` | `true` | iOS, Android, Web | ## Ref Methods diff --git a/docs/TEXT_API_REFERENCE.md b/docs/TEXT_API_REFERENCE.md index 938641da0..100285b74 100644 --- a/docs/TEXT_API_REFERENCE.md +++ b/docs/TEXT_API_REFERENCE.md @@ -42,7 +42,7 @@ If `true`, external HTML (e.g. from Google Docs, Word, web pages) will be normal | Type | Default Value | Platform | | ------ | ------------- | ----------------- | -| `bool` | `false` | iOS, Android, Web | +| `bool` | `true` | iOS, Android, Web | ### `ellipsizeMode` diff --git a/src/native/EnrichedText.tsx b/src/native/EnrichedText.tsx index ec24debfd..f2a9f952c 100644 --- a/src/native/EnrichedText.tsx +++ b/src/native/EnrichedText.tsx @@ -29,7 +29,7 @@ export const EnrichedText = ({ children, style, htmlStyle: _htmlStyle = {}, - useHtmlNormalizer = false, + useHtmlNormalizer = true, ellipsizeMode = 'tail', numberOfLines = 0, selectable = false, diff --git a/src/types.ts b/src/types.ts index 90282deff..acda85b41 100644 --- a/src/types.ts +++ b/src/types.ts @@ -758,7 +758,7 @@ export interface EnrichedTextInputProps extends Omit { * normalized through the HTML normalizer before being applied. * This converts arbitrary HTML into the canonical tag subset that the enriched * parser understands. - * Disabled by default. + * Enabled by default. */ useHtmlNormalizer?: boolean; @@ -800,7 +800,7 @@ export interface EnrichedTextProps extends ViewProps { /** * If true, external HTML will be normalized through the HTML normalizer - * before being rendered. Disabled by default. + * before being rendered. Enabled by default. */ useHtmlNormalizer?: boolean; diff --git a/src/utils/EnrichedTextInputDefaultProps.ts b/src/utils/EnrichedTextInputDefaultProps.ts index 7d0c197cd..0cf2b3170 100644 --- a/src/utils/EnrichedTextInputDefaultProps.ts +++ b/src/utils/EnrichedTextInputDefaultProps.ts @@ -7,7 +7,7 @@ export const ENRICHED_TEXT_INPUT_DEFAULT_PROPS = { autoCapitalize: 'sentences', scrollEnabled: true, androidExperimentalSynchronousEvents: false, - useHtmlNormalizer: false, + useHtmlNormalizer: true, allowFontScaling: true, textShortcuts: [ { trigger: '- ', style: 'unordered_list' }, diff --git a/src/web/EnrichedText.tsx b/src/web/EnrichedText.tsx index 0cc316435..3c00b8f85 100644 --- a/src/web/EnrichedText.tsx +++ b/src/web/EnrichedText.tsx @@ -30,7 +30,7 @@ export const EnrichedText = memo( style, selectionColor, selectable = false, - useHtmlNormalizer = false, + useHtmlNormalizer = true, onFocus, onBlur, }: EnrichedTextProps) => { diff --git a/src/web/EnrichedTextInput.tsx b/src/web/EnrichedTextInput.tsx index 750829052..088e6a43c 100644 --- a/src/web/EnrichedTextInput.tsx +++ b/src/web/EnrichedTextInput.tsx @@ -117,7 +117,7 @@ export const EnrichedTextInput = ({ onEndMention, linkRegex, htmlStyle, - useHtmlNormalizer, + useHtmlNormalizer = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.useHtmlNormalizer, }: EnrichedTextInputProps) => { const tiptapContent = defaultValue != null From ecee839d1b798a268d09783dab493c88b05e94ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Szyd=C5=82owski?= <9szydlowski9@gmail.com> Date: Tue, 7 Jul 2026 19:27:05 +0200 Subject: [PATCH 2/2] fix: the spaces in docs again Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/INPUT_API_REFERENCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/INPUT_API_REFERENCE.md b/docs/INPUT_API_REFERENCE.md index 224d98dbc..783ace3ab 100644 --- a/docs/INPUT_API_REFERENCE.md +++ b/docs/INPUT_API_REFERENCE.md @@ -597,7 +597,7 @@ type TextShortcutStyle = - `trigger` is the typed pattern that activates the shortcut. - `style` is the style to apply when the trigger completes. -**[Paragraph styles](../README.md#paragraph-tags)** fire at the start of a paragraph (e.g. `#` → H1, `-` → unordered list). Supported styles: `h1`–`h6`, `blockquote`, `codeblock`, `unordered_list`, `ordered_list`, `checkbox_list`. +**[Paragraph styles](../README.md#paragraph-tags)** fire at the start of a paragraph (e.g. `# ` → H1, `- ` → unordered list). Supported styles: `h1`–`h6`, `blockquote`, `codeblock`, `unordered_list`, `ordered_list`, `checkbox_list`. > [!NOTE] > Paragraph shortcuts are only effective on plain paragraphs. If the paragraph already has an active paragraph style (e.g. it is already a heading or a list item), typing the trigger pattern has no effect.