Skip to content

Commit

Permalink
fix mermaid class problem
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranchen committed Apr 27, 2019
1 parent 512791d commit f29086d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nodeppt-parser/lib/markdown/mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = md => {
const token = tokens[idx];
const code = token.content;
if (token.info === 'mermaid') {
token.attrJoin('class', 'lang-mermaid no-style');
let attrs = token.attrs || [];
attrs = attrs
.map(([key, value]) => {
Expand All @@ -13,7 +14,7 @@ module.exports = md => {
// 增加对 mermaidjs 支持,这样就可以画流程图了哦~
return `
<div class="embed">
<pre class="lang-mermaid no-style" ${attrs}>${code}</pre>
<pre ${attrs}>${code}</pre>
</div>
`;
}
Expand Down

0 comments on commit f29086d

Please sign in to comment.