【发布时间】:2020-09-18 18:00:55
【问题描述】:
我正在使用Showdown。
当我运行这段代码时:
const showdown = require("showdown")
converter = new showdown.Converter()
const myMarkdownText = '## Some important text'
const myHtmlText = converter.makeHtml(myMarkdownText)
我明白了
<h2 id="someimportanttext">Some important text</h2>
这是预期的结果。
但是当我运行这段代码时:
const showdown = require("showdown")
converter = new showdown.Converter()
const myMarkdownText = '<div markdown = "1"> ## Some important text </div>'
const myHtmlText = converter.makeHtml(myMarkdownText)
我明白了
<div markdown = "1"><p>## Some important text </p></div>
这意味着 Showdown 没有解析 html div 中的内容。
关于如何使它工作的任何帮助?
【问题讨论】: