diff --git a/packages/markdown/index.js b/packages/markdown/index.js index d630d8ec3..b824cf4f2 100644 --- a/packages/markdown/index.js +++ b/packages/markdown/index.js @@ -83,32 +83,6 @@ sanitize.tagNames.push('figcaption'); sanitize.tagNames.push('input'); // allow GitHub-style todo lists sanitize.ancestors.input = ['li']; -const toggleLoosemode = ({ loosemode = false }) => { - if (loosemode) { - const tags = ['iframe', 'button', 'label', 'input', 'video', 'source', 'script']; - const attr = [ - 'id', - 'style', - 'class', - 'height', - 'width', - 'src', - 'name', - 'checked', - 'controls', - 'type', - 'disabled', - 'placeholder', - '*', - ]; - tags.forEach(tag => { - sanitize.attributes[tag] = attr; - }); - sanitize.tagNames.push(...tags); - sanitize.required = {}; - delete sanitize.ancestors.input; - } -}; /** * Normalize Magic Block Raw Text */ @@ -167,7 +141,6 @@ export function processor(opts = {}) { export function plain(text, opts = options, components = {}) { if (!text) return null; - toggleLoosemode(opts); return processor(opts) .use(rehypeReact, { @@ -183,7 +156,6 @@ export function plain(text, opts = options, components = {}) { */ export function react(text, opts = options, components = {}) { if (!text) return null; - toggleLoosemode(opts); // eslint-disable-next-line react/prop-types const PinWrap = ({ children }) =>