From 4be508863c8233a0e6943fdce2a3b63e8d0dfc31 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 9 Sep 2026 03:03:51 +0000 Subject: [PATCH] HTML reader: find list style anywhere in the class attribute. Previously `
    ` got DefaultStyle, because the whole class attribute was compared against the known style names. Check each class individually. As a side effect, an unrecognized class no longer prevents falling back to the style attribute. Co-Authored-By: Claude --- src/Text/Pandoc/Readers/HTML.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 61c30f6f2..a7e6b3c29 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -415,10 +415,14 @@ pOrderedList = try $ do let start = fromMaybe 1 $ lookup "start" attribs >>= safeRead let style = fromMaybe DefaultStyle $ (parseTypeAttr <$> lookup "type" attribs) - <|> (parseListStyleType <$> lookup "class" attribs) + <|> (lookup "class" attribs >>= pickClassStyle) <|> (parseListStyleType <$> (lookup "style" attribs >>= pickListStyle)) where pickListStyle = pickStyleAttrProps ["list-style-type", "list-style"] + -- the list style may be one of several words in the class + -- attribute: + pickClassStyle = L.find (/= DefaultStyle) + . map parseListStyleType . T.words -- note: if they have an
      or
        not in scope of a
      • , -- treat it as a list item, though it's not valid xhtml...