LaTeX reader: allow blank lines inside \author
.
This commit is contained in:
parent
9ecf6a2d19
commit
0b5e2601f5
2 changed files with 20 additions and 6 deletions
|
@ -538,7 +538,7 @@ inNote ils =
|
||||||
inlineCommand' :: PandocMonad m => LP m Inlines
|
inlineCommand' :: PandocMonad m => LP m Inlines
|
||||||
inlineCommand' = try $ do
|
inlineCommand' = try $ do
|
||||||
Tok _ (CtrlSeq name) cmd <- anyControlSeq
|
Tok _ (CtrlSeq name) cmd <- anyControlSeq
|
||||||
guard $ name /= "begin" && name /= "end"
|
guard $ name /= "begin" && name /= "end" && name /= "and"
|
||||||
star <- option "" ("*" <$ symbol '*' <* sp)
|
star <- option "" ("*" <$ symbol '*' <* sp)
|
||||||
overlay <- option "" overlaySpecification
|
overlay <- option "" overlaySpecification
|
||||||
let name' = name <> star <> overlay
|
let name' = name <> star <> overlay
|
||||||
|
@ -1275,10 +1275,7 @@ addMeta field val = updateState $ \st ->
|
||||||
authors :: PandocMonad m => LP m ()
|
authors :: PandocMonad m => LP m ()
|
||||||
authors = try $ do
|
authors = try $ do
|
||||||
bgroup
|
bgroup
|
||||||
let oneAuthor = mconcat <$>
|
let oneAuthor = blocksToInlines' . B.toList . mconcat <$> many1 block
|
||||||
many1 (notFollowedBy' (controlSeq "and") >>
|
|
||||||
(inline <|> mempty <$ blockCommand))
|
|
||||||
-- skip e.g. \vspace{10pt}
|
|
||||||
auths <- sepBy oneAuthor (controlSeq "and")
|
auths <- sepBy oneAuthor (controlSeq "and")
|
||||||
egroup
|
egroup
|
||||||
addMeta "author" (map trimInlines auths)
|
addMeta "author" (map trimInlines auths)
|
||||||
|
@ -1468,7 +1465,7 @@ section (ident, classes, kvs) lvl = do
|
||||||
blockCommand :: PandocMonad m => LP m Blocks
|
blockCommand :: PandocMonad m => LP m Blocks
|
||||||
blockCommand = try $ do
|
blockCommand = try $ do
|
||||||
Tok _ (CtrlSeq name) txt <- anyControlSeq
|
Tok _ (CtrlSeq name) txt <- anyControlSeq
|
||||||
guard $ name /= "begin" && name /= "end"
|
guard $ name /= "begin" && name /= "end" && name /= "and"
|
||||||
star <- option "" ("*" <$ symbol '*' <* sp)
|
star <- option "" ("*" <$ symbol '*' <* sp)
|
||||||
let name' = name <> star
|
let name' = name <> star
|
||||||
let names = ordNub [name', name]
|
let names = ordNub [name', name]
|
||||||
|
|
17
test/command/6324.md
Normal file
17
test/command/6324.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
```
|
||||||
|
% pandoc -f latex -t native -s
|
||||||
|
\documentclass{article}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\title{Document title}
|
||||||
|
\author{
|
||||||
|
|
||||||
|
Me
|
||||||
|
|
||||||
|
}
|
||||||
|
\maketitle
|
||||||
|
\end{document}
|
||||||
|
^D
|
||||||
|
Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Me"]]),("title",MetaInlines [Str "Document",Space,Str "title"])]})
|
||||||
|
[]
|
||||||
|
```
|
Loading…
Add table
Reference in a new issue