@@ -80,6 +80,10 @@ newtype PropertyValue = PropertyValue { fromValue :: String }
8080toPropertyValue :: String -> PropertyValue
8181toPropertyValue = PropertyValue
8282
83+-- | Check whether the property value is non-nil (i.e. truish).
84+isNonNil :: PropertyValue -> Bool
85+isNonNil p = map toLower (fromValue p) `notElem` ["()", "{}", "nil"]
86+
8387-- | Key/value pairs from a PROPERTIES drawer
8488type Properties = [(PropertyKey, PropertyValue)]
8589
@@ -200,12 +204,16 @@ propertiesToAttr properties =
200204 toStringPair prop = (fromKey (fst prop), fromValue (snd prop))
201205 customIdKey = toPropertyKey "custom_id"
202206 classKey = toPropertyKey "class"
207+ unnumberedKey = toPropertyKey "unnumbered"
208+ specialProperties = [customIdKey, classKey, unnumberedKey]
203209 id' = fromMaybe mempty . fmap fromValue . lookup customIdKey $ properties
204210 cls = fromMaybe mempty . fmap fromValue . lookup classKey $ properties
205− kvs' = map toStringPair . filter ((`notElem` [customIdKey, classKey]) . fst)
211+ kvs' = map toStringPair . filter ((`notElem` specialProperties) . fst)
206212 $ properties
213+ isUnnumbered =
214+ fromMaybe False . fmap isNonNil . lookup unnumberedKey $ properties
207215 in
208− (id', words cls, kvs')
216+ (id', words cls ++ (if isUnnumbered then ["unnumbered"] else []), kvs')
209217
210218tagTitle :: Inlines -> [Tag] -> Inlines
211219tagTitle title tags = title <> (mconcat $ map tagToInline tags)