mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-14 18:27:44 +02:00
Merge branch 'dev' of github.com:laurent22/joplin into dev
This commit is contained in:
commit
de43a44c1f
@ -24,10 +24,14 @@ export default {
|
|||||||
const token = tokens[idx];
|
const token = tokens[idx];
|
||||||
if (token.info !== 'mermaid') return defaultRender(tokens, idx, options, env, self);
|
if (token.info !== 'mermaid') return defaultRender(tokens, idx, options, env, self);
|
||||||
const contentHtml = markdownIt.utils.escapeHtml(token.content);
|
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 `
|
return `
|
||||||
<div class="joplin-editable">
|
<div class="joplin-editable">
|
||||||
<pre class="joplin-source" data-joplin-language="mermaid" data-joplin-source-open="\`\`\`mermaid " data-joplin-source-close=" \`\`\` ">${contentHtml}</pre>
|
<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>
|
</div>
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user