Skip to content

Commit

Permalink
Make line breaks HTML-compliant on native
Browse files Browse the repository at this point in the history
  • Loading branch information
marktoman committed Feb 15, 2023
1 parent 37539d9 commit b973cb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ import fontFamily from '../../styles/fontFamily';
const propTypes = {
/** Whether text elements should be selectable */
textSelectable: PropTypes.bool,

/** Handle line breaks according to the HTML standard (default on web) */
enableExperimentalBRCollapsing: PropTypes.bool,

children: PropTypes.node,
};

const defaultProps = {
textSelectable: false,
children: null,
enableExperimentalBRCollapsing: false,
};

// Declare nonstandard tags and their content model here
Expand Down Expand Up @@ -70,6 +75,7 @@ const BaseHTMLEngineProvider = (props) => {
defaultViewProps={defaultViewProps}
renderers={htmlRenderers}
computeEmbeddedMaxWidth={HTMLEngineUtils.computeEmbeddedMaxWidth}
enableExperimentalBRCollapsing={props.enableExperimentalBRCollapsing}
>
{props.children}
</RenderHTMLConfigProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/components/HTMLEngineProvider/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import BaseHTMLEngineProvider from './BaseHTMLEngineProvider';
import {propTypes, defaultProps} from './htmlEnginePropTypes';

const HTMLEngineProvider = props => (
<BaseHTMLEngineProvider debug={props.debug}>
<BaseHTMLEngineProvider debug={props.debug} enableExperimentalBRCollapsing>
{props.children}
</BaseHTMLEngineProvider>
);
Expand Down

0 comments on commit b973cb8

Please sign in to comment.