Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data PairedTransformer match = PairedTransformer {
- ignoresTagStack :: HtmlTagStack -> Bool
- matchStart :: [match] -> Text -> Maybe (match, Text, Text, Text)
- matchEnd :: Text -> Maybe (match, Text, Text, Text)
- areMatchesPaired :: match -> match -> Bool
- transformPair :: match -> match -> [HtmlEntity] -> [HtmlEntity]
- transformPairs :: forall m. PairedTransformer m -> [HtmlEntity] -> [HtmlEntity]
Documentation
data PairedTransformer match Source #
Settings for transformPairs
.
PairedTransformer | |
|
transformPairs :: forall m. PairedTransformer m -> [HtmlEntity] -> [HtmlEntity] Source #
Some transformations should be done only if a start and an end are paired like parentheses. These even usually can be nested. Even if there is a start and an end they should not be paired unless they are sibling in an HTML tree.
These kinds of scanning are easily turned highly stateful and imperative, hence hard to debug. This base class provides the common logic between these kinds of paired transformations so that an implementation class fill several abstract methods triggered by the state machine.