mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-11 17:10:36 +03:00
Remove ability to inline HTML content in iFrames
This commit is contained in:
parent
94f9ddefa4
commit
888a1f4c60
|
@ -57,18 +57,12 @@ SoundCloud.propTypes = {
|
||||||
color: PropTypes.string,
|
color: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatHTML(html) {
|
const Iframe = ({ title, src, width = 800, height = 300 }) => {
|
||||||
const encoded = encodeURIComponent(html)
|
|
||||||
return `<html><head><meta charset="UTF-8"></head><body>${encoded}</body></html>`
|
|
||||||
}
|
|
||||||
|
|
||||||
const Iframe = ({ title, src, html, width = 800, height = 300 }) => {
|
|
||||||
const source = html ? `data:text/html,${formatHTML(html)}` : src
|
|
||||||
return (
|
return (
|
||||||
<iframe
|
<iframe
|
||||||
className={classes.standalone}
|
className={classes.standalone}
|
||||||
title={title}
|
title={title}
|
||||||
src={source}
|
src={src}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
allowFullScreen
|
allowFullScreen
|
||||||
|
|
Loading…
Reference in New Issue
Block a user