git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #3019 from tarleb/org-verbatim-fix
06a3e6aJohn MacFarlane
src/Text/Pandoc/Readers/Org/Inlines.hs+4−2
@@ -614,7 +614,7 @@ displayMath = return . B.displayMath <$> choice [ rawMathBetween "\\[" "\\]"
614 ]
614 ]
615
615
616updatePositions :: Char
616updatePositions :: Char
617− -> OrgParser (Char)
617+ -> OrgParser Char
618updatePositions c = do
618updatePositions c = do
619 when (c `elem` emphasisPreChars) updateLastPreCharPos
619 when (c `elem` emphasisPreChars) updateLastPreCharPos
620 when (c `elem` emphasisForbiddenBorderChars) updateLastForbiddenCharPos
620 when (c `elem` emphasisForbiddenBorderChars) updateLastForbiddenCharPos
@@ -637,7 +637,9 @@ verbatimBetween :: Char
637 -> OrgParser String
637 -> OrgParser String
638verbatimBetween c = try $
638verbatimBetween c = try $
639 emphasisStart c *>
639 emphasisStart c *>
640− many1TillNOrLessNewlines 1 (noneOf "\n\r") (emphasisEnd c)
640+ many1TillNOrLessNewlines 1 verbatimChar (emphasisEnd c)
641+ where
642+ verbatimChar = noneOf "\n\r" >>= updatePositions
641
643
642-- | Parses a raw string delimited by @c@ using Org's math rules
644-- | Parses a raw string delimited by @c@ using Org's math rules
643mathStringBetween :: Char
645mathStringBetween :: Char
tests/Tests/Readers/Org.hs+3
@@ -185,6 +185,9 @@ tests =
185 , "3" <> subscript "{}"
185 , "3" <> subscript "{}"
186 , "4" <> superscript ("(a(" <> strong "b(c" <> ")d))")
186 , "4" <> superscript ("(a(" <> strong "b(c" <> ")d))")
187 ])
187 ])
188+ , "Verbatim text can contain equal signes (=)" =:
189+ "=is_subst = True=" =?>
190+ para (code "is_subst = True")
188
191
189 , "Image" =:
192 , "Image" =:
190 "[[./sunset.jpg]]" =?>
193 "[[./sunset.jpg]]" =?>