Created
March 28, 2020 17:48
-
-
Save mjanssen/1b572a0b25fcbdbd4debe370e3e251a5 to your computer and use it in GitHub Desktop.
Output of rollup compiling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | |
var React = _interopDefault(require('react')); | |
function Html(_ref) { | |
var className = _ref.className, | |
children = _ref.children, | |
_ref$comp = _ref.comp, | |
C = _ref$comp === void 0 ? "div" : _ref$comp; | |
if (typeof children === "string") { | |
var tags = ["script", "style", "iframe"]; | |
var regex = "<(".concat(tags.join("|"), ")[^>]*>.*</(").concat(tags.join("|"), ")>"); | |
children = children.replace(new RegExp(regex), ""); | |
} | |
return ( | |
/*#__PURE__*/ | |
// @ts-ignore for dangerouslySetInnerHTML and IntrinsicAttributes | |
React.createElement(C, { | |
className: className, | |
dangerouslySetInnerHTML: { | |
__html: children | |
} | |
}) | |
); | |
} | |
module.exports = Html; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment