Ξυ³h&/",$      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€ Safe-Inferred"=γτ 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||][""]( markup-parseΣValue of an attribute. "" is equivalent to true with respect to boolean attributes.) markup-parseName of an attribute.* markup-parseA Markup token6runParser_ (many (token Html)) [i|content|]2[StartTag "foo" [],Content "content",EndTag "foo"]"runParser_ (token Xml) [i||]EmptyElemTag "foo" []*runParser_ (token Html) ""Comment " Comment "ΒrunParser_ (token Xml) [i||]-Decl "xml version=\"1.0\" encoding=\"UTF-8\"")runParser_ (token Html) ""Doctype "DOCTYPE html"8runParser_ (token Xml) ""&Doctype "DOCTYPE foo [ declarations ]"7runParser (token Html) [i||]ΟOK (StartTag "foo" [Attr "a" "a",Attr "b" "b",Attr "c" "c",Attr "check" ""]) ""6runParser (token Xml) [i||]Fail+ markup-parse A start tag. 5https://developer.mozilla.org/en-US/docs/Glossary/Tag, markup-parseΗAn empty element tag. Optional for XML and kind of not allowed in HTML.- markup-parseA closing tag.. markup-parseThe content between tags./ markup-parseContents of a comment.0 markup-parseContents of a declaration1 markup-parse"Contents of a doctype declaration.2 markup-parse Name of token3 markup-parse*The structure of many returning 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)4 markup-parseώmarkup-parse generally tries to continue on parse errors, and return what has/can still be parsed, together with any warnings.5 markup-parse1A tag ending with "/>" that is not an element of P (Html only).6 markup-parseΝA tag ending with "/>" that has children. Cannot happen in the parsing phase.7 markup-parseOnly a + can have child tokens.8 markup-parseΐA CloseTag with a different name to the currently open StartTag.9 markup-parse)An EndTag with no corresponding StartTag.: markup-parse&An EndTag with corresponding StartTag.; markup-parse!An EndTag should never appear in >< markup-parse'Empty Content, Comment, Decl or Doctype> markup-parseA … list of markup *s*markup Html "baz"¦That (Markup {standard = Html, markupTree = [Node {rootLabel = StartTag "foo" [Attr "class" "bar"], subForest = [Node {rootLabel = Content "baz", subForest = []}]}]})B markup-parse•From 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.E markup-parseConvert any warnings to an †$resultError $ (tokenize Html) "!markup Html "
|])K markup-parse(Are the trees in the markup well-formed?L markup-parse;Check for well-formedness and rerturn warnings encountered. wellFormed $ Markup Html [Node (Comment "") [], Node (EndTag "foo") [], Node (EmptyElemTag "foo" []) [Node (Content "bar") []], Node (EmptyElemTag "foo" []) []]<[EmptyContent,EndTagInTree,LeafWithChildren,BadEmptyElemTag]M markup-parse A flatparse * parser.+runParser (token Html) "content"&OK (StartTag "foo" []) "content"N markup-parseParse a bytestring into tokens%tokenize Html [i|content|]7That [StartTag "foo" [],Content "content",EndTag "foo"]O markup-parse tokenize but errors on warnings.P markup-parseHtml tags that self-close‡ markup-parseβnormalize 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.Q markup-parsebytestring representation of *.#detokenize Html (StartTag "foo" [])""R markup-parseConvert > to bytestringsΔB.putStr $ markdown (Indented 4) (markup_ Html [i|
|])

S markup-parseδGather together token trees from a token list, placing child elements in nodes and removing EndTags.baz
"ύThat [Node {rootLabel = StartTag "foo" [Attr "class" "bar"], subForest = [Node {rootLabel = Content "baz", subForest = []}]}]T markup-parsegather but errors on warnings.U markup-parse4Convert a markup into a token list, adding end tags.7degather =<< markup Html "baz"ΕThat [StartTag "foo" [Attr "class" "bar"],Content "baz",EndTag "foo"]V markup-parsedegather but errors on warningŠ markup-parse0name string according to xml production rule [5]‹ markup-parse+XML declaration as per production rule [23]W markup-parsexml production [24]X markup-parsexml production [26]Œ markup-parse/Doctype declaration as per production rule [28]Y markup-parseXml production [32]Z markup-parse Xml yes/no[ markup-parsexml production [80]\ markup-parsexml production [81] markup-parseΟopen 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 &^ markup-parseParse attributions<#$%&'()*0/+,-.123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^<>?@ABCDHI#$%RJLK456789:;<=3EFG2]P)(&'^*0/+,-.1NOMQSTUVW[YX\Z Safe-Inferred, markup-parse7compare a markup file with a round-trip transformation.€ markup-parse‘% with unchanged sections filtered out patch [1, 2, 3, 5] [0, 1, 2, 4, 6]"Just [+0, -3, +4, -5, +6]"€€’      !"#$%&'()**+,-./0123456789:;<=>?@AABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…ƒ„†ƒ„‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œž+markup-parse-0.0.0.2-HnQ2lGo9uJcI0zQ43aTniKMarkupParse.FlatParse MarkupParseMarkupParse.Patch ParserWarningParserLeftover ParserErrorParserUncaughtrunParserMayberunParserEither runParserWarn runParser_ws_ isWhitespacewswsssqdqnotaisa byteStringOf' wrappedSq wrappedDqwrappedQwrappedQNoGuardeqsep bracketed bracketedSBwrappeddigitintdoublesigned$fEqParserWarning$fShowParserWarning$fOrdParserWarning$fGenericParserWarning$fNFDataParserWarning RenderStyleCompactIndentedAttr AttrValueAttrNameTokenStartTag EmptyElemTagEndTagContentCommentDeclDoctypeTagNameResult MarkupWarningBadEmptyElemTagSelfCloserWithChildrenLeafWithChildren TagMismatchUnmatchedEndTag UnclosedTag EndTagInTree EmptyContent MarkupParserMarkupstandard markupTreeStandardHtmlXml resultError resultEither resultMaybemarkupmarkup_ normalize isWellFormed wellFormedtokentokenize tokenize_ selfClosers detokenizemarkdowngathergather_degather degather_xmlVersionInfo xmlVersionNum xmlStandalonexmlYesNoxmlEncodingDecl xmlEncNamenameattrs$fToExprStandard $fToExprAttr $fNFDataAttr $fToExprToken $fNFDataToken$fToExprMarkup$fEqRenderStyle$fShowRenderStyle$fGenericRenderStyle $fShowMarkup $fEqMarkup $fOrdMarkup$fGenericMarkup$fNFDataMarkup $fShowToken $fOrdToken $fEqToken$fGenericToken $fGenericAttr $fShowAttr$fEqAttr $fOrdAttr$fEqMarkupWarning$fShowMarkupWarning$fOrdMarkupWarning$fGenericMarkupWarning$fNFDataMarkupWarning $fEqStandard$fShowStandard $fOrdStandard$fGenericStandard$fNFDataStandard goldenPatchpatch(flatparse-0.5.0.1-5UrmBxIjfc61M7qOmrutv5FlatParse.BasicErrFail byteStringOfthese-1.2-UBdGAEuHN58xE7uqj4k9i Data.TheseThesecontainers-0.6.5.1 Data.TreeTreebaseGHC.Errerror normAttrs renderAttrs renderAttrnameXmldeclXml doctypeXml startTagsXml endTagXml tokenHtmlattr(tree-diff-0.3.0.1-9kp7yyxP4SYFOymatbapJJData.TreeDiff.Classediff