MCPcopy Index your code
hub / github.com/dataease/SQLBot / kP

Function kP

frontend/public/swagger-ui-bundle.js:69114–69136  ·  view source on GitHub ↗
({
          source: s,
          className: o = '',
          getConfigs: i = () => ({ useUnsafeMarkdown: !1 }),
        })

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 5

sanitizerFunction · 0.85
useMethod · 0.80
iFunction · 0.70
JnFunction · 0.50
renderMethod · 0.45

Tested by

no test coverage detected