git.iko.soy/typeable/pandoc
on master help sign in
Revert "Shared: export extractIds."
3765f08John MacFarlane
src/Text/Pandoc/Shared.hs−20
@@ -64,7 +64,6 @@ module Text.Pandoc.Shared (
64 Element (..),
64 Element (..),
65 hierarchicalize,
65 hierarchicalize,
66 uniqueIdent,
66 uniqueIdent,
67− extractIds,
68 inlineListToIdentifier,
67 inlineListToIdentifier,
69 isHeaderBlock,
68 isHeaderBlock,
70 headerShift,
69 headerShift,
@@ -530,25 +529,6 @@ headerLtEq level (Header l _ _) = l <= level
530headerLtEq level (Div ("",["references"],[]) (Header l _ _ : _)) = l <= level
529headerLtEq level (Div ("",["references"],[]) (Header l _ _ : _)) = l <= level
531headerLtEq _ _ = False
530headerLtEq _ _ = False
532
531
533−-- | Extract the identifiers from a block element.
534−extractBlockIds :: Block -> Set.Set String
535−extractBlockIds (Header _ (ident,_,_) _) | not (null ident) =
536− Set.singleton ident
537−extractBlockIds (Div (ident,_,_) _) | not (null ident) =
538− Set.singleton ident
539−extractBlockIds _ = Set.empty
540−
541−-- | Extract the identifiers from an inline element.
542−extractInlineIds :: Inline -> Set.Set String
543−extractInlineIds (Span (ident,_,_) _) | not (null ident) =
544− Set.singleton ident
545−extractInlineIds _ = Set.empty
546−
547−-- | Extract the identifiers from a pandoc document.
548−extractIds :: Pandoc -> Set.Set String
549−extractIds doc =
550− query extractBlockIds doc `Set.union` query extractInlineIds doc
551−
552-- | Generate a unique identifier from a list of inlines.
532-- | Generate a unique identifier from a list of inlines.
553-- Second argument is a list of already used identifiers.
533-- Second argument is a list of already used identifiers.
554uniqueIdent :: [Inline] -> Set.Set String -> String
534uniqueIdent :: [Inline] -> Set.Set String -> String