aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-01-06 10:11:08 -0800
committerJohn MacFarlane <[email protected]>2025-01-06 10:11:08 -0800
commit9e43625e4ea9410133a104a960659e8883dcbcf3 (patch)
treee632bff65533eb8ea6d03c0c6fcf8a8659a5d7a8
parent1cfccfae6e7527d8cd57e3a834e5d28ff0d799f6 (diff)
Djot reader/writer highlighted text fixes:
- The reader now uses a Span with class "mark" rather than "highlighted", for consistency with the other pandoc readers and writers. - The writer renders a Span with sole class "mark" as highlighted text.
-rw-r--r--src/Text/Pandoc/Readers/Djot.hs2
-rw-r--r--src/Text/Pandoc/Writers/Djot.hs1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Djot.hs b/src/Text/Pandoc/Readers/Djot.hs
index 6cb67f41e..7bf360172 100644
--- a/src/Text/Pandoc/Readers/Djot.hs
+++ b/src/Text/Pandoc/Readers/Djot.hs
@@ -189,7 +189,7 @@ convertInline (D.Node pos attr il) = addAttrToInline pos attr <$>
D.Str bs -> pure $ str (UTF8.toText bs)
D.Emph ils -> emph <$> convertInlines ils
D.Strong ils -> strong <$> convertInlines ils
- D.Highlight ils -> spanWith ("",["highlighted"],[]) <$> convertInlines ils
+ D.Highlight ils -> spanWith ("",["mark"],[]) <$> convertInlines ils
D.Insert ils -> spanWith ("",["inserted"],[]) <$> convertInlines ils
D.Delete ils -> spanWith ("",["deleted"],[]) <$> convertInlines ils
D.Subscript ils -> subscript <$> convertInlines ils
diff --git a/src/Text/Pandoc/Writers/Djot.hs b/src/Text/Pandoc/Writers/Djot.hs
index 703a54347..45ea729eb 100644
--- a/src/Text/Pandoc/Writers/Djot.hs
+++ b/src/Text/Pandoc/Writers/Djot.hs
@@ -212,6 +212,7 @@ inlineToDjot (Strong ils) = D.strong <$> inlinesToDjot ils
inlineToDjot (Strikeout ils) = D.delete <$> inlinesToDjot ils
inlineToDjot (Subscript ils) = D.subscript <$> inlinesToDjot ils
inlineToDjot (Superscript ils) = D.superscript <$> inlinesToDjot ils
+inlineToDjot (Span ("",["mark"],[]) ils) = D.highlight <$> inlinesToDjot ils
inlineToDjot (Span attr@(ident,cls,kvs) ils)
| Just "1" <- lookup "wrapper" kvs
= fmap (D.addAttr