Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/example-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ function App() {
mentionIndicators={['@', '#']}
htmlStyle={WEB_DEFAULT_HTML_STYLE}
linkRegex={LINK_REGEX}
useHtmlNormalizer
/>
<MentionPopup
variant="user"
Expand Down
1 change: 0 additions & 1 deletion apps/example-web/src/components/TextRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function TextRenderer({ htmlValue }: TextRendererProps) {
ref={ref}
style={enrichedTextStyle}
htmlStyle={WEB_DEFAULT_HTML_STYLE}
useHtmlNormalizer
onFocus={handleTextFocus}
onBlur={handleTextBlur}
>
Expand Down
1 change: 0 additions & 1 deletion apps/example/src/components/TextRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const TextRenderer = ({ nodes }: TextRendererProps) => {
htmlStyle={enrichedTextHtmlStyle}
onLinkPress={handleLinkPress}
onMentionPress={handleMentionPress}
useHtmlNormalizer
>
{node}
</EnrichedText>
Expand Down
1 change: 0 additions & 1 deletion apps/example/src/screens/DevScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export function DevScreen({ onSwitch }: DevScreenProps) {
ANDROID_EXPERIMENTAL_SYNCHRONOUS_EVENTS
}
onPasteImages={(e) => editor.handlePasteImagesEvent(e.nativeEvent)}
useHtmlNormalizer
testID="editor-input"
/>
<Toolbar
Expand Down
1 change: 0 additions & 1 deletion apps/example/src/screens/EnrichedTextScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export function EnrichedTextScreen({ onSwitch }: EnrichedTextScreenProps) {
ellipsizeMode={ellipsizeMode}
onLinkPress={handleLinkPress}
onMentionPress={handleMentionPress}
useHtmlNormalizer
>
{html}
</EnrichedText>
Expand Down
1 change: 0 additions & 1 deletion apps/example/src/screens/TestScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export function TestScreen({
ANDROID_EXPERIMENTAL_SYNCHRONOUS_EVENTS
}
onPasteImages={(e) => editor.handlePasteImagesEvent(e.nativeEvent)}
useHtmlNormalizer
testID="editor-input"
/>
<Toolbar
Expand Down
6 changes: 3 additions & 3 deletions docs/INPUT_API_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/TEXT_API_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion src/native/EnrichedText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const EnrichedText = ({
children,
style,
htmlStyle: _htmlStyle = {},
useHtmlNormalizer = false,
useHtmlNormalizer = true,
ellipsizeMode = 'tail',
numberOfLines = 0,
selectable = false,
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ export interface EnrichedTextInputProps extends Omit<ViewProps, 'children'> {
* 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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/EnrichedTextInputDefaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const ENRICHED_TEXT_INPUT_DEFAULT_PROPS = {
autoCapitalize: 'sentences',
scrollEnabled: true,
androidExperimentalSynchronousEvents: false,
useHtmlNormalizer: false,
useHtmlNormalizer: true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, worth checking it out before we enable it by default

allowFontScaling: true,
textShortcuts: [
{ trigger: '- ', style: 'unordered_list' },
Expand Down
2 changes: 1 addition & 1 deletion src/web/EnrichedText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const EnrichedText = memo(
style,
selectionColor,
selectable = false,
useHtmlNormalizer = false,
useHtmlNormalizer = true,
onFocus,
onBlur,
}: EnrichedTextProps) => {
Expand Down
2 changes: 1 addition & 1 deletion src/web/EnrichedTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const EnrichedTextInput = ({
onEndMention,
linkRegex,
htmlStyle,
useHtmlNormalizer,
useHtmlNormalizer = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.useHtmlNormalizer,
}: EnrichedTextInputProps) => {
const tiptapContent =
defaultValue != null
Expand Down