git.iko.soy/typeable/pandoc
on master help sign in
JATS writer: wrap figure caption in <p> to fix validation (#5292)

closes #5290

commitd0a5f2aded6ace0e6310b622d6560fa9fee1d9e3 authorMauro Bieg <mb21@users.noreply.github.com> dateSun 10 Feb 2019, 16:22 (8 years ago) parentf27d029
2 files changed+2−2
src/Text/Pandoc/Writers/JATS.hs+1−1 test/writer.jats+1−1
src/Text/Pandoc/Writers/JATS.hs+1−1
@@ -230,7 +230,7 @@ blockToJATS opts (Para [Image (ident,_,kvs) txt
230230 let (maintype, subtype) = imageMimeType src kvs
231231 let capt = if null txt
232232 then empty
233− else inTagsSimple "caption" alt
233+ else inTagsSimple "caption" $ inTagsSimple "p" alt
234234 let attr = [("id", ident) | not (null ident)] ++
235235 [(k,v) | (k,v) <- kvs, k `elem` ["fig-type", "orientation",
236236 "position", "specific-use"]]
test/writer.jats+1−1
@@ -835,7 +835,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
835835 <title>Images</title>
836836 <p>From “Voyage dans la Lune” by Georges Melies (1902):</p>
837837 <fig>
838− <caption>lalune</caption>
838+ <caption><p>lalune</p></caption>
839839 <graphic mimetype="image" mime-subtype="jpeg" xlink:href="lalune.jpg" xlink:title="Voyage dans la Lune" />
840840 </fig>
841841 <p>Here is a movie