File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed
Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 1+ -- jats.lua
2+ -- Copyright (C) 2021-2022 Posit Software, PBC
3+
4+
5+
6+
7+ function jats ()
8+ return {
9+ -- clear out divs
10+ Div = function (div )
11+ if _quarto .format .isJatsOutput () then
12+ -- unroll blocks contained in divs
13+ local blocks = pandoc .List ()
14+ for _ , childBlock in ipairs (div .content ) do
15+ if childBlock .t == " Div" then
16+ tappend (blocks , childBlock .content )
17+ else
18+ blocks :insert (childBlock )
19+ end
20+ end
21+ return blocks
22+ end
23+ end
24+ }
25+ end
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import("latexdiv.lua")
1717import (" foldcode.lua" )
1818import (" fig-cleanup.lua" )
1919import (" ipynb.lua" )
20+ import (" jats.lua" )
2021import (" ojs.lua" )
2122import (" reveal.lua" )
2223import (" tikz.lua" )
@@ -50,6 +51,7 @@ return {
5051 figCleanup (),
5152 pdfImages ()
5253 }),
54+ jats (),
5355 ojs (),
5456 quartoPostMetaInject (),
5557}
Original file line number Diff line number Diff line change @@ -181,6 +181,16 @@ local function isAstOutput()
181181 return isNativeOutput () or isJsonOutput ()
182182end
183183
184+ local function isJatsOutput ()
185+ local formats = {
186+ " jats" ,
187+ " jats_archiving" ,
188+ " jats_articleauthoring" ,
189+ " jats_publishing" ,
190+ }
191+ return tcontains (formats , FORMAT )
192+ end
193+
184194
185195return {
186196 isRawHtml = isRawHtml ,
@@ -204,5 +214,6 @@ return {
204214 isBibliographyOutput = isBibliographyOutput ,
205215 isNativeOutput = isNativeOutput ,
206216 isJsonOutput = isJsonOutput ,
207- isAstOutput = isAstOutput
217+ isAstOutput = isAstOutput ,
218+ isJatsOutput = isJatsOutput
208219}
You can’t perform that action at this time.
0 commit comments