Skip to content

Commit 5bff522

Browse files
charpeniExilz
authored andcommitted
Handle srcdoc in iframe
1 parent 870c172 commit 5bff522

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/HTMLRenderers.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ export function ul (htmlAttribs, children, convertedCSSStyles, passProps = {}) {
113113
export const ol = ul;
114114

115115
export function iframe (htmlAttribs, children, convertedCSSStyles, passProps) {
116-
if (!htmlAttribs.src) {
117-
return false;
118-
}
119116
const { staticContentMaxWidth, tagsStyles, classesStyles } = passProps;
120117

121118
const tagStyleHeight = tagsStyles.iframe && tagsStyles.iframe.height;
@@ -139,8 +136,10 @@ export function iframe (htmlAttribs, children, convertedCSSStyles, passProps) {
139136
additionalStyles: [{ height, width }]
140137
});
141138

139+
const source = htmlAttribs.srcdoc ? { html: htmlAttribs.srcdoc } : { uri: htmlAttribs.src };
140+
142141
return (
143-
<WebView key={passProps.key} source={{ uri: htmlAttribs.src }} style={style} />
142+
<WebView key={passProps.key} source={source} style={style} />
144143
);
145144
}
146145

0 commit comments

Comments
 (0)