Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve text inside code fences #14822

Merged
merged 5 commits into from
Feb 20, 2023
Merged
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
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