| 69112 | xP.addHook('beforeSanitizeElements', function (s) { |
| 69113 | return (s.href && s.setAttribute('rel', 'noopener noreferrer'), s) |
| 69114 | }) |
| 69115 | const kP = function Markdown({ |
| 69116 | source: s, |
| 69117 | className: o = '', |
| 69118 | getConfigs: i = () => ({ useUnsafeMarkdown: !1 }), |
| 69119 | }) { |
| 69120 | if ('string' != typeof s) return null |
| 69121 | const a = new Remarkable({ |
| 69122 | html: !0, |
| 69123 | typographer: !0, |
| 69124 | breaks: !0, |
| 69125 | linkTarget: '_blank', |
| 69126 | }).use(linkify) |
| 69127 | a.core.ruler.disable(['replacements', 'smartquotes']) |
| 69128 | const { useUnsafeMarkdown: u } = i(), |
| 69129 | _ = a.render(s), |
| 69130 | w = sanitizer(_, { useUnsafeMarkdown: u }) |
| 69131 | return s && _ && w |
| 69132 | ? Re.createElement('div', { |
| 69133 | className: Jn()(o, 'markdown'), |
| 69134 | dangerouslySetInnerHTML: { __html: w }, |
| 69135 | }) |
| 69136 | : null |
| 69137 | } |
| 69138 | function sanitizer(s, { useUnsafeMarkdown: o = !1 } = {}) { |
| 69139 | const i = o, |