From 83880b0dbc318703babfbb6905b1046fa48f1216 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 5 May 2020 14:31:48 -0700 Subject: 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. --- src/Text/Pandoc/Shared.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text') 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') -- cgit v1.2.3