aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-07-14 08:43:39 -0700
committerGitHub <noreply@github.com>2016-07-14 08:43:39 -0700
commit06a3e6a03f8cdef118bea59c45230b80b9534b19 (patch)
treeece20055f6e49de6dca8ced94a73f22d363dc405
parent00b11bcbcf514585411aac7e578c1a718ff5de20 (diff)
parent529146decf7f0e390964bb7aa709082af6e8639b (diff)
downloadpandoc-06a3e6a03f8cdef118bea59c45230b80b9534b19.tar.gz
Merge pull request #3019 from tarleb/org-verbatim-fix
Org reader: fix parsing of verbatim inlines
-rw-r--r--src/Text/Pandoc/Readers/Org/Inlines.hs6
-rw-r--r--tests/Tests/Readers/Org.hs3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs
index 6a8773c3c..e1a66a8c7 100644
--- a/src/Text/Pandoc/Readers/Org/Inlines.hs
+++ b/src/Text/Pandoc/Readers/Org/Inlines.hs
@@ -614,7 +614,7 @@ displayMath = return . B.displayMath <$> choice [ rawMathBetween "\\[" "\\]"
]
updatePositions :: Char
- -> OrgParser (Char)
+ -> OrgParser Char
updatePositions c = do
when (c `elem` emphasisPreChars) updateLastPreCharPos
when (c `elem` emphasisForbiddenBorderChars) updateLastForbiddenCharPos
@@ -637,7 +637,9 @@ verbatimBetween :: Char
-> OrgParser String
verbatimBetween c = try $
emphasisStart c *>
- many1TillNOrLessNewlines 1 (noneOf "\n\r") (emphasisEnd c)
+ many1TillNOrLessNewlines 1 verbatimChar (emphasisEnd c)
+ where
+ verbatimChar = noneOf "\n\r" >>= updatePositions
-- | Parses a raw string delimited by @c@ using Org's math rules
mathStringBetween :: Char
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index fdd9bc6bf..1f8a8a01e 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -185,6 +185,9 @@ tests =
, "3" <> subscript "{}"
, "4" <> superscript ("(a(" <> strong "b(c" <> ")d))")
])
+ , "Verbatim text can contain equal signes (=)" =:
+ "=is_subst = True=" =?>
+ para (code "is_subst = True")
, "Image" =:
"[[./sunset.jpg]]" =?>