1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

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

This commit is contained in:
XPhyro 2024-06-19 12:55:05 +03:00 committed by GitHub
parent 818f9f58d1
commit 0ec917bb96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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>