mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-24 08:12:24 +02:00
parent
e954ecd024
commit
e81c7f2dd2
@ -24,10 +24,14 @@ export default {
|
||||
const token = tokens[idx];
|
||||
if (token.info !== 'mermaid') return defaultRender(tokens, idx, options, env, self);
|
||||
const contentHtml = markdownIt.utils.escapeHtml(token.content);
|
||||
// Note: The mermaid script (`contentHtml`) needs to be wrapped
|
||||
// in a `pre` tag, otherwise in WYSIWYG mode TinyMCE removes
|
||||
// all the white space from it, which causes mermaid to fail.
|
||||
// See PR #4670 https://github.com/laurent22/joplin/pull/4670
|
||||
return `
|
||||
<div class="joplin-editable">
|
||||
<pre class="joplin-source" data-joplin-language="mermaid" data-joplin-source-open="\`\`\`mermaid " data-joplin-source-close=" \`\`\` ">${contentHtml}</pre>
|
||||
<div class="mermaid">${contentHtml}</div>
|
||||
<pre class="mermaid">${contentHtml}</pre>
|
||||
</div>
|
||||
`;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user