Skip to content

Commit ff0fa2c

Browse files
committed
chore: useHtmlNormalizer enabled by default
1 parent 390b66d commit ff0fa2c

13 files changed

Lines changed: 11 additions & 17 deletions

File tree

apps/example-web/src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ function App() {
280280
mentionIndicators={['@', '#']}
281281
htmlStyle={WEB_DEFAULT_HTML_STYLE}
282282
linkRegex={LINK_REGEX}
283-
useHtmlNormalizer
284283
/>
285284
<MentionPopup
286285
variant="user"

apps/example-web/src/components/TextRenderer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export function TextRenderer({ htmlValue }: TextRendererProps) {
3030
ref={ref}
3131
style={enrichedTextStyle}
3232
htmlStyle={WEB_DEFAULT_HTML_STYLE}
33-
useHtmlNormalizer
3433
onFocus={handleTextFocus}
3534
onBlur={handleTextBlur}
3635
>

apps/example/src/components/TextRenderer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const TextRenderer = ({ nodes }: TextRendererProps) => {
3535
htmlStyle={enrichedTextHtmlStyle}
3636
onLinkPress={handleLinkPress}
3737
onMentionPress={handleMentionPress}
38-
useHtmlNormalizer
3938
>
4039
{node}
4140
</EnrichedText>

apps/example/src/screens/DevScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export function DevScreen({ onSwitch }: DevScreenProps) {
7373
ANDROID_EXPERIMENTAL_SYNCHRONOUS_EVENTS
7474
}
7575
onPasteImages={(e) => editor.handlePasteImagesEvent(e.nativeEvent)}
76-
useHtmlNormalizer
7776
testID="editor-input"
7877
/>
7978
<Toolbar

apps/example/src/screens/EnrichedTextScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export function EnrichedTextScreen({ onSwitch }: EnrichedTextScreenProps) {
116116
ellipsizeMode={ellipsizeMode}
117117
onLinkPress={handleLinkPress}
118118
onMentionPress={handleMentionPress}
119-
useHtmlNormalizer
120119
>
121120
{html}
122121
</EnrichedText>

apps/example/src/screens/TestScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export function TestScreen({
9595
ANDROID_EXPERIMENTAL_SYNCHRONOUS_EVENTS
9696
}
9797
onPasteImages={(e) => editor.handlePasteImagesEvent(e.nativeEvent)}
98-
useHtmlNormalizer
9998
testID="editor-input"
10099
/>
101100
<Toolbar

docs/INPUT_API_REFERENCE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ type TextShortcutStyle =
597597
- `trigger` is the typed pattern that activates the shortcut.
598598
- `style` is the style to apply when the trigger completes.
599599

600-
**[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`.
600+
**[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`.
601601

602602
> [!NOTE]
603603
> 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
639639
| ------ | ------------- | -------- |
640640
| `bool` | `false` | Android |
641641

642-
### `useHtmlNormalizer` - EXPERIMENTAL
642+
### `useHtmlNormalizer`
643643

644-
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.
644+
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.
645645

646646
| Type | Default Value | Platform |
647647
| ------ | ------------- | ----------------- |
648-
| `bool` | `false` | iOS, Android, Web |
648+
| `bool` | `true` | iOS, Android, Web |
649649

650650
## Ref Methods
651651

docs/TEXT_API_REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ If `true`, external HTML (e.g. from Google Docs, Word, web pages) will be normal
4242

4343
| Type | Default Value | Platform |
4444
| ------ | ------------- | ----------------- |
45-
| `bool` | `false` | iOS, Android, Web |
45+
| `bool` | `true` | iOS, Android, Web |
4646

4747
### `ellipsizeMode`
4848

src/native/EnrichedText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const EnrichedText = ({
2929
children,
3030
style,
3131
htmlStyle: _htmlStyle = {},
32-
useHtmlNormalizer = false,
32+
useHtmlNormalizer = true,
3333
ellipsizeMode = 'tail',
3434
numberOfLines = 0,
3535
selectable = false,

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ export interface EnrichedTextInputProps extends Omit<ViewProps, 'children'> {
758758
* normalized through the HTML normalizer before being applied.
759759
* This converts arbitrary HTML into the canonical tag subset that the enriched
760760
* parser understands.
761-
* Disabled by default.
761+
* Enabled by default.
762762
*/
763763
useHtmlNormalizer?: boolean;
764764

@@ -800,7 +800,7 @@ export interface EnrichedTextProps extends ViewProps {
800800

801801
/**
802802
* If true, external HTML will be normalized through the HTML normalizer
803-
* before being rendered. Disabled by default.
803+
* before being rendered. Enabled by default.
804804
*/
805805
useHtmlNormalizer?: boolean;
806806

0 commit comments

Comments
 (0)