summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>2017-12-22 18:30:22 +1300
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-21 22:30:22 -0700
commita5d7be075d6aa3afd817bfb754b5c84cac63614b (patch)
tree42d360a253afc019bde5bbec44498e61b059d3fa /src
parentde8c47eae807ae8ecc96eb24cd1fed6cf8e6b932 (diff)
JATS writer: Make <p> optional in <td> and <th> (#4178)
If the contents are single `Plain` block then do not wrap them with a <p> element.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/JATS.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
index ee3d61015..901bcb646 100644
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -316,6 +316,9 @@ tableItemToJATS :: PandocMonad m
-> Bool
-> [Block]
-> JATS m Doc
+tableItemToJATS opts isHeader [Plain item] =
+ inTags True (if isHeader then "th" else "td") [] <$>
+ inlinesToJATS opts item
tableItemToJATS opts isHeader item =
(inTags True (if isHeader then "th" else "td") [] . vcat) <$>
mapM (blockToJATS opts) item