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) { function renderFountainScript(markdownIt: any, content: string) {
const result = fountain.parse(content); const result = fountain.parse(content);
return ` let titlePageHtml = '';
<div class="fountain joplin-editable"> if (result.html.title_page) {
<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="title-page"> <div class="title-page">
${result.html.title_page} ${result.html.title_page}
</div> </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"> <div class="page">
${result.html.script} ${result.html.script}
</div> </div>