From 0ec917bb96e420ab33d87cde284548b77eb9e2c5 Mon Sep 17 00:00:00 2001 From: XPhyro Date: Wed, 19 Jun 2024 12:55:05 +0300 Subject: [PATCH] All: Don't render empty title page for Fountain (#10631) --- packages/renderer/MdToHtml/rules/fountain.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/renderer/MdToHtml/rules/fountain.ts b/packages/renderer/MdToHtml/rules/fountain.ts index 01c0b0718..9386640ec 100644 --- a/packages/renderer/MdToHtml/rules/fountain.ts +++ b/packages/renderer/MdToHtml/rules/fountain.ts @@ -107,12 +107,19 @@ const pluginAssets = function() { function renderFountainScript(markdownIt: any, content: string) { const result = fountain.parse(content); - return ` -
-
${markdownIt.utils.escapeHtml(content)}
+ let titlePageHtml = ''; + if (result.html.title_page) { + titlePageHtml = `
${result.html.title_page}
+ `; + } + + return ` +
+
${markdownIt.utils.escapeHtml(content)}
+ ${titlePageHtml}
${result.html.script}