瀏覽代碼

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

bubble
Kyle Shockey 7 年之前
父節點
當前提交
21100a0a8b
沒有發現已知的金鑰在資料庫的簽署中 GPG Key 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}


Loading…
取消
儲存