git.iko.soy/typeable/pandoc
on master help sign in
Org reader: make tildes create inline code.

Closes #1345. Also relabeled 'code' and 'verbatim' parsers to accord with the org-mode manual. I'm not sure what the distinction between code and verbatim is supposed to be, but I'm pretty sure both should be represented as Code inlines in pandoc. The previous behavior resulted in the text not appearing in any output format.

commit78ee2416d105bd25337819a49835623a8a296224 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 16 Jun 2014, 22:03 (12 years ago) parentf9b97e6
2 files changed+7−7
src/Text/Pandoc/Readers/Org.hs+4−4 tests/Tests/Readers/Org.hs+3−3
src/Text/Pandoc/Readers/Org.hs+4−4
@@ -1148,11 +1148,11 @@ strikeout = fmap B.strikeout <$> emphasisBetween '+'
11481148underline :: OrgParser (F Inlines)
11491149underline = fmap B.strong <$> emphasisBetween '_'
11501150
1151−code :: OrgParser (F Inlines)
1152−code = return . B.code <$> verbatimBetween '='
1153−
11541151verbatim :: OrgParser (F Inlines)
1155−verbatim = return . B.rawInline "" <$> verbatimBetween '~'
1152+verbatim = return . B.code <$> verbatimBetween '='
1153+
1154+code :: OrgParser (F Inlines)
1155+code = return . B.code <$> verbatimBetween '~'
11561156
11571157subscript :: OrgParser (F Inlines)
11581158subscript = fmap B.subscript <$> try (char '_' *> subOrSuperExpr)
tests/Tests/Readers/Org.hs+3−3
@@ -50,13 +50,13 @@ tests =
5050 "+Kill Bill+" =?>
5151 para (strikeout . spcSep $ [ "Kill", "Bill" ])
5252
53− , "Code" =:
53+ , "Verbatim" =:
5454 "=Robot.rock()=" =?>
5555 para (code "Robot.rock()")
5656
57− , "Verbatim" =:
57+ , "Code" =:
5858 "~word for word~" =?>
59− para (rawInline "" "word for word")
59+ para (code "word for word")
6060
6161 , "Math $..$" =:
6262 "$E=mc^2$" =?>