Skip to content

Commit f9dc23a

Browse files
committed
some tweaks to docusaurus raw html handling
1 parent 2b30a37 commit f9dc23a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/resources/extensions/quarto/docusaurus/docusaurus.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Pandoc(doc)
1919
if #rawHtmlVars > 0 then
2020
local exports = ("export const %s =\n[%s];"):format(kQuartoRawHtml,
2121
table.concat(
22-
rawHtmlVars:map(function(var) return '`\n'.. var .. '\n`' end),
22+
rawHtmlVars:map(function(var) return '`'.. var .. '`' end),
2323
","
2424
)
2525
)
@@ -59,7 +59,8 @@ function RawBlock(el)
5959
elseif el.format == 'html' then
6060
-- track the raw html vars (we'll insert them at the top later on as
6161
-- mdx requires all exports be declared together)
62-
rawHtmlVars:insert(el.text)
62+
local html = string.gsub(el.text, "\n+", "\n")
63+
rawHtmlVars:insert(html)
6364

6465
-- generate a div container for the raw html and return it as the block
6566
local html = ("<div dangerouslySetInnerHTML={{ __html: %s[%d] }} />")

0 commit comments

Comments
 (0)