@@ -38,10 +38,9 @@ import qualified Text.Pandoc.Parsing as P
38import Text.Pandoc.Parsing hiding ( F, unF, askF, asksF, runF
38import Text.Pandoc.Parsing hiding ( F, unF, askF, asksF, runF
39 , newline, orderedListMarker
39 , newline, orderedListMarker
40 , parseFromString
40 , parseFromString
41− , updateLastStrPos )
41+ )
42import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)
42import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)
43import Text.Pandoc.Shared (compactify', compactify'DL)
43import Text.Pandoc.Shared (compactify', compactify'DL)
44−import Text.Parsec.Pos (updatePosString)
45import Text.TeXMath (texMathToPandoc, DisplayType(..))
44import Text.TeXMath (texMathToPandoc, DisplayType(..))
47import Control.Applicative ( Applicative, pure
46import Control.Applicative ( Applicative, pure
@@ -148,10 +147,6 @@ resetBlockAttributes :: OrgParser ()
148resetBlockAttributes = updateState $ \s ->
147resetBlockAttributes = updateState $ \s ->
149 s{ orgStateBlockAttributes = orgStateBlockAttributes def }
148 s{ orgStateBlockAttributes = orgStateBlockAttributes def }
151−updateLastStrPos :: OrgParser ()
152−updateLastStrPos = getPosition >>= \p ->
153− updateState $ \s -> s{ orgStateLastStrPos = Just p }
155updateLastForbiddenCharPos :: OrgParser ()
150updateLastForbiddenCharPos :: OrgParser ()
156updateLastForbiddenCharPos = getPosition >>= \p ->
151updateLastForbiddenCharPos = getPosition >>= \p ->
157 updateState $ \s -> s{ orgStateLastForbiddenCharPos = Just p}
152 updateState $ \s -> s{ orgStateLastForbiddenCharPos = Just p}
@@ -1376,8 +1371,9 @@ maybeRight = either (const Nothing) Just
1376inlineLaTeXCommand :: OrgParser String
1371inlineLaTeXCommand :: OrgParser String
1377inlineLaTeXCommand = try $ do
1372inlineLaTeXCommand = try $ do
1378 rest <- getInput
1373 rest <- getInput
1380 case runParser rawLaTeXInline def "source" rest of
1374 case runParser rawLaTeXInline def "source" rest of
1381− Right (RawInline _ cs) -> cs <$ (setInput $ drop (length cs) rest)
1375+ Right (RawInline _ cs) -> do
1382− <* (setPosition $ updatePosString pos cs)
1376+ let len = length cs
1383 _ -> mzero
1379 _ -> mzero