All: Don't render empty title page for Fountain (#10631)

This commit is contained in:
XPhyro
2024-06-19 10:55:05 +01:00
committed by GitHub
parent 818f9f58d1
commit 0ec917bb96
+10 -3
View File
@@ -107,12 +107,19 @@ const pluginAssets = function() {
function renderFountainScript(markdownIt: any, content: string) {
const result = fountain.parse(content);
return `
<div class="fountain joplin-editable">
<pre class="joplin-source" data-joplin-language="fountain" data-joplin-source-open="\`\`\`fountain&#10;" data-joplin-source-close="&#10;\`\`\`&#10;">${markdownIt.utils.escapeHtml(content)}</pre>
let titlePageHtml = '';
if (result.html.title_page) {
titlePageHtml = `
<div class="title-page">
${result.html.title_page}
</div>
`;
}
return `
<div class="fountain joplin-editable">
<pre class="joplin-source" data-joplin-language="fountain" data-joplin-source-open="\`\`\`fountain&#10;" data-joplin-source-close="&#10;\`\`\`&#10;">${markdownIt.utils.escapeHtml(content)}</pre>
${titlePageHtml}
<div class="page">
${result.html.script}
</div>