git.iko.soy/typeable/pandoc
on master help sign in
Org reader: make tildes create inline code.
78ee241John MacFarlane
src/Text/Pandoc/Readers/Org.hs+4−4
@@ -1148,11 +1148,11 @@ strikeout = fmap B.strikeout <$> emphasisBetween '+'
1148underline :: OrgParser (F Inlines)
1148underline :: OrgParser (F Inlines)
1149underline = fmap B.strong <$> emphasisBetween '_'
1149underline = fmap B.strong <$> emphasisBetween '_'
1150
1150
1151−code :: OrgParser (F Inlines)
1152−code = return . B.code <$> verbatimBetween '='
1153−
1154verbatim :: OrgParser (F Inlines)
1151verbatim :: OrgParser (F Inlines)
1152+verbatim = return . B.code <$> verbatimBetween '='
1153+
1154+code :: OrgParser (F Inlines)
1155−verbatim = return . B.rawInline "" <$> verbatimBetween '~'
1155+code = return . B.code <$> verbatimBetween '~'
1156
1156
1157subscript :: OrgParser (F Inlines)
1157subscript :: OrgParser (F Inlines)
1158subscript = fmap B.subscript <$> try (char '_' *> subOrSuperExpr)
1158subscript = fmap B.subscript <$> try (char '_' *> subOrSuperExpr)
tests/Tests/Readers/Org.hs+3−3
@@ -50,13 +50,13 @@ tests =
50 "+Kill Bill+" =?>
50 "+Kill Bill+" =?>
51 para (strikeout . spcSep $ [ "Kill", "Bill" ])
51 para (strikeout . spcSep $ [ "Kill", "Bill" ])
52
52
53− , "Code" =:
53+ , "Verbatim" =:
54 "=Robot.rock()=" =?>
54 "=Robot.rock()=" =?>
55 para (code "Robot.rock()")
55 para (code "Robot.rock()")
56
56
57− , "Verbatim" =:
57+ , "Code" =:
58 "~word for word~" =?>
58 "~word for word~" =?>
59− para (rawInline "" "word for word")
59+ para (code "word for word")
60
60
61 , "Math $..$" =:
61 , "Math $..$" =:
62 "$E=mc^2$" =?>
62 "$E=mc^2$" =?>