ソースを参照

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}


読み込み中…
キャンセル
保存