aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-05-05 14:31:48 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-05-05 14:31:48 -0700
commit83880b0dbc318703babfbb6905b1046fa48f1216 (patch)
treef105a2666bcb1215a6b12fa67cf9895f1fc1c8c0 /src/Text/Pandoc/Shared.hs
parent6fad52b05724d5b1e2b877c0f600389faa6e6ac0 (diff)
downloadpandoc-83880b0dbc318703babfbb6905b1046fa48f1216.tar.gz
Shared.makeSections: omit number attribute when unnumbered class...
...is present. Previously the attribute was included but given an empty value, and this caused the table of contents creation functions in T.P.Writers.Shared to think these items had numbers, which meant that they were included in the TOC even if the `unlisted` class was used. Closes #6339.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index dc1adb42b..9a293d2ab 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -579,7 +579,8 @@ makeSections numbering mbBaseLevel bs =
rest' <- go rest
let kvs' = -- don't touch number if already present
case lookup "number" kvs of
- Nothing | numbering ->
+ Nothing | numbering
+ , not ("unnumbered" `elem` classes) ->
("number", T.intercalate "." (map tshow newnum)) : kvs
_ -> kvs
let divattr = (ident, "section":classes, kvs')