h&Bb>h      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred"=M  markup-parseWarnings covering leftovers, s and runParserWarn ws " x"These (ParserLeftover "x") ' 'runParserWarn ws "x"This ParserUncaught,runParserWarn (ws `cut` "no whitespace") "x""This (ParserError "no whitespace") markup-parse2Run a Parser, throwing away leftovers. Nothing on  or .runParserMaybe ws "x"NothingrunParserMaybe ws " x"Just ' ' markup-parse7Run a Parser, throwing away leftovers. Returns Left on  or .runParserEither ws " x" Right ' ' markup-parse.Run parser, returning leftovers and errors as  s.runParserWarn ws " "That ' 'runParserWarn ws "x"This ParserUncaughtrunParserWarn ws " x"These (ParserLeftover "x") ' ' markup-parse tokenize_ Html [i||][""]7 markup-parseValue of an attribute. "" is equivalent to true with respect to boolean attributes.8 markup-parseName of an attribute.9 markup-parseMost functions return a Q rather than an 9 because it is often more ergonomic to use the free monoid (aka a list) in preference to returning a  9 (say).: markup-parse*A Markup token. The term is borrowed from  >https://www.w3.org/html/wg/spec/tokenization.html#tokenizationHTML standards but is used across U and V in this library.Note that the :1 type is used in two slightly different contexts:4As an intermediary representation of markup between  and Q.As the primitives of Q 9sSpecifically, an <; will occur in a list of tokens, but not as a primitive in Q. It may turn out to be better to have two different types for these two uses and future iterations of this library may head in this direction.7runParser_ (many (tokenP Html)) [i|content|]:[OpenTag StartTag "foo" [],Content "content",EndTag "foo"]#runParser_ (tokenP Xml) [i||]OpenTag EmptyElemTag "foo" []+runParser_ (tokenP Html) ""Comment " Comment "runParser_ (tokenP Xml) [i||]Decl "xml" [Attr {attrName = "version", attrValue = " version=\"1.0\""},Attr {attrName = "encoding", attrValue = "UTF-8"}]*runParser_ (tokenP Html) ""Doctype "DOCTYPE html"9runParser_ (tokenP Xml) ""&Doctype "DOCTYPE foo [ declarations ]"8runParser (tokenP Html) [i||]OK (OpenTag StartTag "foo" [Attr {attrName = "a", attrValue = "a"},Attr {attrName = "b", attrValue = "b"},Attr {attrName = "c", attrValue = "c"},Attr {attrName = "check", attrValue = ""}]) ""7runParser (tokenP Xml) [i||]Fail; markup-parseA tag. 5https://developer.mozilla.org/en-US/docs/Glossary/Tag< markup-parseA closing tag.= markup-parseThe content between tags.> markup-parseContents of a comment.? markup-parseContents of a declaration@ markup-parse"Contents of a doctype declaration.A markup-parse>Whether an opening tag is a start tag or an empty element tag.D markup-parse Name of tokenE markup-parseA type synonym for the common returning type of many functions. A common computation pipeline is to take advantage of the  Monad instance eg markup s bs = bs & (tokenize s >=> gather s) & second (Markup s)F markup-parsemarkup-parse generally tries to continue on parse errors, and return what has/can still be parsed, together with any warnings.G markup-parse1A tag ending with "/>" that is not an element of g (Html only).H markup-parseA tag ending with "/>" that has children. Cannot happen in the parsing phase.I markup-parseOnly a B can have child tokens.J markup-parseA CloseTag with a different name to the currently open StartTag.K markup-parse)An EndTag with no corresponding StartTag.L markup-parse)An StartTag with no corresponding EndTag.M markup-parse!An EndTag should never appear in QN markup-parse'Empty Content, Comment, Decl or DoctypeO markup-parseBadly formed declarationQ markup-parse A list of 9s or  :s*markup Html "baz"That (Markup {elements = [Node {rootLabel = OpenTag StartTag "foo" [Attr {attrName = "class", attrValue = "bar"}], subForest = [Node {rootLabel = Content "baz", subForest = []}]}]})T markup-parseFrom a parsing pov, Html & Xml (& Svg) are close enough that they share a lot of parsing logic, so that parsing and printing just need some tweaking.?The xml parsing logic is based on the XML productions found in https://www.w3.org/TR/xml/+The html parsing was based on a reading of  .https://hackage.haskell.org/package/html-parse html-parse, but ignores the various 'x00' to 'xfffd' & eof directives that form part of the html standards.W markup-parseConvert any warnings to an "warnError $ (tokenize Html) "
|])] markup-parse(Are the trees in the markup well-formed?^ markup-parse:Check for well-formedness and return warnings encountered.wellFormed Html $ Markup [Node (Comment "") [], Node (EndTag "foo") [], Node (OpenTag EmptyElemTag "foo" []) [Node (Content "bar") []], Node (OpenTag EmptyElemTag "foo" []) []]<[EmptyContent,EndTagInTree,LeafWithChildren,BadEmptyElemTag]_ markup-parseEscape a single character.` markup-parse' = ">" escapeChar '&' = "&" escapeChar '\''' = "'" escapeChar '"' = """ No attempt is made to meet the https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_referencesHTML Standards#escape [i||]3"<foo class="a" bar='b'>"a markup-parseAppend attributes to an existing Token attribute list. Returns Nothing for tokens that do not have attributes.b markup-parseStandard Html Doctype"markdown_ Compact Html doctypeHtml""c markup-parseStandard Xml Doctype markdown_ Compact Xml doctypeXml""d markup-parse A flatparse : parser.,runParser (tokenP Html) "content".OK (OpenTag StartTag "foo" []) "content"e markup-parseParse a bytestring into tokens%tokenize Html [i|content|]?That [OpenTag StartTag "foo" [],Content "content",EndTag "foo"]f markup-parse tokenize but errors on warnings.g markup-parseHtml tags that self-closeh markup-parseCreate Q= from a name tag and attributes that wraps some other markup.#element "div" [] (element_ "br" [])Markup {elements = [Node {rootLabel = OpenTag StartTag "div" [], subForest = [Node {rootLabel = OpenTag StartTag "br" [], subForest = []}]}]}i markup-parseCreate Q from a name tag and attributes that doesn't wrap some other markup. The A used is B. Use j if you want to create C based markup.(element_ "br" [])Markup {elements = [Node {rootLabel = OpenTag StartTag "br" [], subForest = []}]}j markup-parseCreate Q& from a name tag and attributes using C, that doesn't wrap some other markup. No checks are made on whether this creates well-formed markup.emptyElem "br" []Markup {elements = [Node {rootLabel = OpenTag EmptyElemTag "br" [], subForest = []}]}k markup-parseCreate Q0 from a name tag and attributes that wraps some =. No escaping is performed.elementc "div" [] "content"Markup {elements = [Node {rootLabel = OpenTag StartTag "div" [], subForest = [Node {rootLabel = Content "content", subForest = []}]}]}l markup-parseCreate Q =2 from a bytestring, escaping the usual characters.content ""Markup {elements = [Node {rootLabel = Content "<content>", subForest = []}]}m markup-parseCreate a Markup element from a bytestring, not escaping the usual characters.contentRaw ""Markup {elements = [Node {rootLabel = Content "", subForest = []}]}>markup_ Html $ markdown_ Compact Html $ contentRaw ""*** Exception: UnclosedTag... markup-parsenormalize an attribution list, removing duplicate AttrNames, and space concatenating class values. markup-parserender attributes markup-parserender an attribute)Does not attempt to escape double quotes.n markup-parsebytestring representation of :.+detokenize Html (OpenTag StartTag "foo" [])""o markup-parseConvert Q to bytestrings>markdown (Indented 4) Html (markup_ Html [i|
|])That "\n
\n
"p markup-parseConvert Q to  and error on warnings.B.putStr $ markdown_ (Indented 4) Html (markup_ Html [i|
|])

q markup-parseNormalise Content in Markup, concatenating adjacent Content, and removing mempty Content.6normContent $ content "a" <> content "" <> content "b"Markup {elements = [Node {rootLabel = Content "ab", subForest = []}]}r markup-parseGather together token trees from a token list, placing child elements in nodes and removing EndTags.baz
"That (Markup {elements = [Node {rootLabel = OpenTag StartTag "foo" [Attr {attrName = "class", attrValue = "bar"}], subForest = [Node {rootLabel = Content "baz", subForest = []}]}]})s markup-parser but errors on warnings.t markup-parse4Convert a markup into a token list, adding end tags.baz
"That [OpenTag StartTag "foo" [Attr {attrName = "class", attrValue = "bar"}],Content "baz",EndTag "foo"]u markup-parset but errors on warning markup-parse0name string according to xml production rule [5] markup-parse+XML declaration as per production rule [23]v markup-parsexml production [24]w markup-parsexml production [26] markup-parse/Doctype declaration as per production rule [28]x markup-parsexml production [32]y markup-parse xml yes/noz markup-parsexml production [80]{ markup-parsexml production [81] markup-parseopen xml tag as per xml production rule [40] self-closing xml tag as per [44] markup-parseclosing tag as per [42] markup-parseParse a single :.| markup-parse6Parse a tag name. Each standard is slightly different. markup-parse Parse an 3} markup-parseParse attributions 0123456789:?>;<=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}QRSTUVZ[012op\q^]FGHIJKLMNOPEWXY9hijklmDgbc873456a}|ABC:?>;<=@efdnrstuvzxw{y _` Safe-Inferred>X markup-parse0Compare a file with a round-trip transformation. markup-parse% with unchanged sections filtered out.showPatch $ patch [1, 2, 3, 5] [0, 1, 2, 4, 6]"[+0, -3, +4, -5, +6]" markup-parse*Create a String representation of a patch.        !"#$%&'()*+,-./0123456789:;<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ )markup-parse-0.1.1-BdYhv7KNpuBDovL7j9hJZ4 MarkupParseMarkupParse.FlatParseMarkupParse.Patchcontainers-0.6.5.1 Data.Tree subForest rootLabelNodeTree(flatparse-0.5.0.1-5UrmBxIjfc61M7qOmrutv5FlatParse.Basic runParserErrFailOKResultFlatParse.Basic.ParserParserFlatParse.Common.Assorted utf8ToStr strToUtf8 ParserWarningParserLeftover ParserErrorParserUncaughtrunParserMayberunParserEither runParserWarn runParser_ws_ isWhitespacewswsssqdqnotaisa byteStringOf' wrappedSq wrappedDqwrappedQwrappedQNoGuardeqsep bracketed bracketedSBwrappeddigitintdoublesignedcomma$fEqParserWarning$fShowParserWarning$fOrdParserWarning$fGenericParserWarning$fNFDataParserWarning RenderStyleCompactIndentedAttrattrName attrValue AttrValueAttrNameElementTokenOpenTagEndTagContentCommentDeclDoctype OpenTagTypeStartTag EmptyElemTagNameTagWarn MarkupWarningBadEmptyElemTagSelfCloserWithChildrenLeafWithChildren TagMismatchUnmatchedEndTag UnclosedTag EndTagInTree EmptyContentBadDecl MarkupParserMarkupelementsStandardHtmlXml warnError warnEither warnMaybemarkupmarkup_ normalize isWellFormed wellFormed escapeCharescapeaddAttrs doctypeHtml doctypeXmltokenPtokenize tokenize_ selfCloserselementelement_ emptyElemelementccontent contentRaw detokenizemarkdown markdown_ normContentgathergather_degather degather_xmlVersionInfoPxmlVersionNumPxmlStandaloneP xmlYesNoPxmlEncodingDeclP xmlEncNamePnamePattrsP $fToExprAttr $fNFDataAttr$fEqRenderStyle$fShowRenderStyle$fGenericRenderStyle $fShowMarkup $fEqMarkup $fOrdMarkup$fGenericMarkup$fNFDataMarkup$fToExprMarkup$fSemigroupMarkup$fMonoidMarkup $fShowToken $fOrdToken $fEqToken$fGenericToken $fNFDataToken $fToExprToken $fGenericAttr $fShowAttr$fEqAttr $fOrdAttr$fShowOpenTagType$fOrdOpenTagType$fEqOpenTagType$fGenericOpenTagType$fNFDataOpenTagType$fToExprOpenTagType$fEqMarkupWarning$fShowMarkupWarning$fOrdMarkupWarning$fGenericMarkupWarning$fNFDataMarkupWarning $fEqStandard$fShowStandard $fOrdStandard$fGenericStandard$fNFDataStandard$fToExprStandard goldenPatchpatch showPatch byteStringOfghc-prim GHC.TypesIntDoublebase GHC.MaybeMaybebytestring-0.11.3.1Data.ByteString.Internal ByteStringthese-1.2-UBdGAEuHN58xE7uqj4k9i Data.TheseTheseGHC.Errerror normAttrs renderAttrs renderAttrnameXmlPdeclXmlP doctypeXmlP startTagsXmlP endTagXmlP tokenHtmlPattrP(tree-diff-0.3.0.1-9kp7yyxP4SYFOymatbapJJData.TreeDiff.Classediff