浏览代码

Don't render Markdown if input or sanitized input is empty

bubble
Kyle Shockey 7 年前
父节点
当前提交
21100a0a8b
找不到此签名对应的密钥 GPG 密钥 ID: DC20D559FFBC0D36
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. +6
    -0
      src/core/components/providers/markdown.jsx

+ 6
- 0
src/core/components/providers/markdown.jsx 查看文件

@@ -11,6 +11,12 @@ const sanitizeOptions = {

function Markdown({ source }) {
const sanitized = sanitize(source, sanitizeOptions)

// sometimes the sanitizer returns "undefined" as a string
if(!source || !sanitized || sanitized === "undefined") {
return null
}

return <Remarkable
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
source={sanitized}


正在加载...
取消
保存