git.iko.soy/typeable/pandoc
on master help sign in
Org reader: mark verbatim code with class "verbatim". (#6998)

* Replace org-mode’s verbatim from code to codeWith. This adds the `"verbatim"` class so that exporters can apply a specific style on it. For instance, it will be possible for HTML to add a CSS rule for code + verbatim class. * Alter test for org-mode’s verbatim change. See previous commit for further detail on the new implementation.

commit57b10941521d9db808e3892ea9893878065b7c50 authorDimitri Sabadie <dimitri.sabadie@gmail.com> dateSun 3 Jan 2021, 08:57 (6 years ago) parent260aaaa
2 files changed+3−3
src/Text/Pandoc/Readers/Org/Inlines.hs+1−1 test/Tests/Readers/Org/Inline.hs+2−2
src/Text/Pandoc/Readers/Org/Inlines.hs+1−1
@@ -572,7 +572,7 @@ underline :: PandocMonad m => OrgParser m (F Inlines)
572572underline = fmap B.underline <$> emphasisBetween '_'
573573
574574verbatim :: PandocMonad m => OrgParser m (F Inlines)
575−verbatim = return . B.code <$> verbatimBetween '='
575+verbatim = return . B.codeWith ("", ["verbatim"], []) <$> verbatimBetween '='
576576
577577code :: PandocMonad m => OrgParser m (F Inlines)
578578code = return . B.code <$> verbatimBetween '~'
test/Tests/Readers/Org/Inline.hs+2−2
@@ -56,7 +56,7 @@ tests =
5656
5757 , "Verbatim" =:
5858 "=Robot.rock()=" =?>
59− para (code "Robot.rock()")
59+ para (codeWith ("", ["verbatim"], []) "Robot.rock()")
6060
6161 , "Code" =:
6262 "~word for word~" =?>
@@ -190,7 +190,7 @@ tests =
190190 ])
191191 , "Verbatim text can contain equal signes (=)" =:
192192 "=is_subst = True=" =?>
193− para (code "is_subst = True")
193+ para (codeWith ("", ["verbatim"], []) "is_subst = True")
194194
195195 , testGroup "Images"
196196 [ "Image" =: