File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
resources/formats/html/pandoc-selfcontained Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export const pandocIngestSelfContainedContent = async (
4848
4949 // The raw html contents
5050 const contents = Deno . readTextFileSync ( file ) ;
51+ const doctypeMatch = contents . match ( / ^ < ! D O C T Y P E .* ?> / ) ;
5152 const dom = await parseHtml ( contents ) ;
5253 await bundleModules ( dom , workingDir ) ;
5354
@@ -63,6 +64,9 @@ export const pandocIngestSelfContainedContent = async (
6364 cmd . push ( "--template" , template ) ;
6465 cmd . push ( "--output" , filename ) ;
6566 cmd . push ( "--metadata" , "title=placeholder" ) ;
67+ if ( doctypeMatch ) {
68+ cmd . push ( "--variable" , `doctype=${ doctypeMatch [ 0 ] } ` ) ;
69+ }
6670 cmd . push ( "--embed-resources" ) ;
6771 if ( resourcePath && resourcePath . length ) {
6872 cmd . push ( "--resource-path" , resourcePath . join ( ":" ) ) ;
Original file line number Diff line number Diff line change 1+ $if(doctype)$$doctype$$endif$
12$body$
You can’t perform that action at this time.
0 commit comments