"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Text/Pandoc/Readers/LaTeX.hs" between
pandoc-2.14.0.3.tar.gz and pandoc-2.14.1.tar.gz

About: Pandoc converts files from one markup format into another.

LaTeX.hs  (pandoc-2.14.0.3):LaTeX.hs  (pandoc-2.14.1)
skipping to change at line 137 skipping to change at line 137
-- enableExtension Ext_raw_tex $ -- enableExtension Ext_raw_tex $
-- getDefaultExtensions "latex" }} "source" (tokenize "source" t )) -- getDefaultExtensions "latex" }} "source" (tokenize "source" t ))
-- case res of -- case res of
-- Left e -> error (show e) -- Left e -> error (show e)
-- Right r -> return r -- Right r -> return r
rawLaTeXBlock :: (PandocMonad m, HasMacros s, HasReaderOptions s) rawLaTeXBlock :: (PandocMonad m, HasMacros s, HasReaderOptions s)
=> ParserT Sources s m Text => ParserT Sources s m Text
rawLaTeXBlock = do rawLaTeXBlock = do
lookAhead (try (char '\\' >> letter)) lookAhead (try (char '\\' >> letter))
inp <- getInput toks <- getInputTokens
let toks = tokenizeSources inp
snd <$> (rawLaTeXParser toks False (macroDef (const mempty)) blocks snd <$> (rawLaTeXParser toks False (macroDef (const mempty)) blocks
<|> rawLaTeXParser toks True <|> rawLaTeXParser toks True
(do choice (map controlSeq (do choice (map controlSeq
["include", "input", "subfile", "usepackage"]) ["include", "input", "subfile", "usepackage"])
skipMany opt skipMany opt
braced braced
return mempty) blocks return mempty) blocks
<|> rawLaTeXParser toks True <|> rawLaTeXParser toks True
(environment <|> blockCommand) (environment <|> blockCommand)
(mconcat <$> many (block <|> beginOrEndCommand))) (mconcat <$> many (block <|> beginOrEndCommand)))
skipping to change at line 168 skipping to change at line 167
if M.member (untokenize envname) if M.member (untokenize envname)
(inlineEnvironments :: M.Map Text (LP PandocPure Inlines)) (inlineEnvironments :: M.Map Text (LP PandocPure Inlines))
then mzero then mzero
else return $ rawBlock "latex" else return $ rawBlock "latex"
(txt <> untokenize rawargs) (txt <> untokenize rawargs)
rawLaTeXInline :: (PandocMonad m, HasMacros s, HasReaderOptions s) rawLaTeXInline :: (PandocMonad m, HasMacros s, HasReaderOptions s)
=> ParserT Sources s m Text => ParserT Sources s m Text
rawLaTeXInline = do rawLaTeXInline = do
lookAhead (try (char '\\' >> letter)) lookAhead (try (char '\\' >> letter))
inp <- getInput toks <- getInputTokens
let toks = tokenizeSources inp
raw <- snd <$> raw <- snd <$>
( rawLaTeXParser toks True ( rawLaTeXParser toks True
(mempty <$ (controlSeq "input" >> skipMany rawopt >> braced)) (mempty <$ (controlSeq "input" >> skipMany rawopt >> braced))
inlines inlines
<|> rawLaTeXParser toks True (inlineEnvironment <|> inlineCommand') <|> rawLaTeXParser toks True (inlineEnvironment <|> inlineCommand')
inlines inlines
) )
finalbraces <- mconcat <$> many (try (string "{}")) -- see #5439 finalbraces <- mconcat <$> many (try (string "{}")) -- see #5439
return $ raw <> T.pack finalbraces return $ raw <> T.pack finalbraces
inlineCommand :: PandocMonad m => ParserT Sources ParserState m Inlines inlineCommand :: PandocMonad m => ParserT Sources ParserState m Inlines
inlineCommand = do inlineCommand = do
lookAhead (try (char '\\' >> letter)) lookAhead (try (char '\\' >> letter))
inp <- getInput toks <- getInputTokens
let toks = tokenizeSources inp
fst <$> rawLaTeXParser toks True (inlineEnvironment <|> inlineCommand') fst <$> rawLaTeXParser toks True (inlineEnvironment <|> inlineCommand')
inlines inlines
-- inline elements: -- inline elements:
word :: PandocMonad m => LP m Inlines word :: PandocMonad m => LP m Inlines
word = str . untoken <$> satisfyTok isWordTok word = str . untoken <$> satisfyTok isWordTok
inlineGroup :: PandocMonad m => LP m Inlines inlineGroup :: PandocMonad m => LP m Inlines
inlineGroup = do inlineGroup = do
 End of changes. 3 change blocks. 
6 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)