summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-08-16 12:40:38 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-08-16 12:40:38 -0700
commitab8c0dcd410282baaa9429f755ad55e6d01a2466 (patch)
tree662277e9a727d32c740318ab3500087a4dd9454a /src
parent309024971c1f4cfea0dc2529cc4b75f02d7def33 (diff)
LaTeX reader: parse label after section command and set id.
Closes #951.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 414e50fc8..50a95c361 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -315,12 +315,14 @@ authors = try $ do
addMeta "authors" (map trimInlines auths)
section :: Attr -> Int -> LP Blocks
-section attr lvl = do
+section (ident, classes, kvs) lvl = do
hasChapters <- stateHasChapters `fmap` getState
let lvl' = if hasChapters then lvl + 1 else lvl
skipopts
contents <- grouped inline
- return $ headerWith attr lvl' contents
+ lab <- option ident $ try $ spaces >> controlSeq "label" >>
+ spaces >> braced
+ return $ headerWith (lab, classes, kvs) lvl' contents
inlineCommand :: LP Inlines
inlineCommand = try $ do