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

Update HTMLEngineProvider to use VideoRenderer #33145

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ function BaseHTMLEngineProvider(props) {
tagName: 'next-steps',
mixedUAStyles: {...styles.textLabelSupporting},
}),
video: defaultHTMLElementModels.div.extend({
tagName: 'video',
mixedUAStyles: {whiteSpace: 'pre'},
}),
}),
[styles.colorMuted, styles.formError, styles.mb0, styles.textLabelSupporting],
);

// We need to memoize this prop to make it referentially stable.
const defaultTextProps = useMemo(() => ({selectable: props.textSelectable, allowFontScaling: false, textBreakStrategy: 'simple'}), [props.textSelectable]);
const defaultViewProps = {style: [styles.alignItemsStart, styles.userSelectText]};

return (
<TRenderEngineProvider
customHTMLElementModels={customHTMLElementModels}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function AnchorRenderer(props) {
const isAttachment = Boolean(htmlAttribs[CONST.ATTACHMENT_SOURCE_ATTRIBUTE]);
const displayName = lodashGet(props.tnode, 'domNode.children[0].data', '');
const parentStyle = lodashGet(props.tnode, 'parent.styles.nativeTextRet', {});
const attrHref = htmlAttribs.href || '';
const attrHref = htmlAttribs.href || htmlAttribs[CONST.ATTACHMENT_SOURCE_ATTRIBUTE] || '';
const internalNewExpensifyPath = Link.getInternalNewExpensifyPath(attrHref);
const internalExpensifyPath = Link.getInternalExpensifyPath(attrHref);

Expand Down
1 change: 1 addition & 0 deletions src/components/HTMLEngineProvider/HTMLRenderers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
a: AnchorRenderer,
code: CodeRenderer,
img: ImageRenderer,
video: AnchorRenderer, // temporary until we have a video player component

// Custom tag renderers
edited: EditedRenderer,
Expand Down
Loading