diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-05-05 14:31:48 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-05-05 14:31:48 -0700 |
commit | 83880b0dbc318703babfbb6905b1046fa48f1216 (patch) | |
tree | f105a2666bcb1215a6b12fa67cf9895f1fc1c8c0 /src/Text | |
parent | 6fad52b05724d5b1e2b877c0f600389faa6e6ac0 (diff) | |
download | pandoc-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')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 3 |
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') |