Z      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY @Z[\]HTags which can be implicitly ended in case they are the last element in J their parent. This list actually includes all of the elements that have I any kind of omittable end tag, since in general when an element with an  omittable end tag isn'+t specified to be omittable in this way, it's just & because in a complete document it isn'%t expected to ever be the last thing  in its parent. We aren'3t interested in enforcing element structure rules,  so we'll allow it anyway. ^ETags which should be considered automatically ended in case one of a  certain set of tags pops up. _`abcdefghijklmnopqrstuvwxyz{|}~@Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~@Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~/CThe character encoding of a document. Currently only the required & character encodings are implemented. 9The internal subset is unparsed, but preserved in case it' s actually  wanted. BAn external ID, as in a document type declaration. This can be a ? SYSTEM identifier, or a PUBLIC identifier, or can be omitted.  AA document type declaration. Note that DTD internal subsets are  currently unimplemented. FA node of a document structure. A node can be text, a comment, or an F element. XML processing instructions are intentionally omitted as a J simplification, and CDATA and plain text are both text nodes, since they + ought to be semantically interchangeable. DRepresents a document fragment, including the format, encoding, and 3 document type declaration as well as its content. ,Determines whether the node is text or not. 1Determines whether the node is a comment or not. 2Determines whether the node is an element or not. %Gives the tag name of an element, or  if the node isn't an  element. 5Retrieves the attribute with the given name. If the   is not an  element, the result is always  (Checks if a given attribute exists in a  . 4Sets the attribute name to the given value. If the   is not an  element, this is the identity. !:Gives the entire text content of a node, ignoring markup. "JGives the child nodes of the given node. Only elements have child nodes. #,Gives the child elements of the given node. $?Gives all of the child elements of the node with the given tag  name. %CGives the first child element of the node with the given tag name,  or $ if there is no such child element. &HGives the descendants of the given node in the order that they begin in  the document. 'IGives the descendant elements of the given node, in the order that their $ start tags appear in the document. (5Gives the descendant elements with a given tag name. )HGives the first descendant element of the node with the given tag name,  or  if there is no such element. FRetrieves the preferred name of a character encoding for embedding in  a document.  Gets the encoding function from  to  for an encoding.  Gets the decoding function from  to  for an encoding. /  !"#$%&'()/    !"#$%&'() 9Represents the state of a text scanner, for use with the   parser combinator. .Specialized type for the parsers we use here. HGet an initial guess at document encoding from the byte order mark. If  the mark doesn'9t exist, guess UTF-8. Otherwise, guess according to the  mark. 2Checks if a document contains invalid characters.  Parses a : value and gives back the result. The parser is expected  to match the entire string. The parser to match Text to parse /Consume input as long as the predicate returns , and return the I consumed input. This parser does not fail. If it matches no input, it  will return an empty string. /Consume input as long as the predicate returns , and return the L consumed input. This parser requires the predicate to succeed on at least H one character of input. It will fail if the first character fails the  predicate. The equivalent of Parsec'0s string combinator, but for text. If there is M not a complete match, then no input is consumed. This matches the behavior  of string# from the attoparsec-text package. JScans text and progresses through a DFA, collecting the complete matching  text as it goes.  +6States for the DOCTYPE internal subset state machine. JThis is my best guess as to the best rule for handling document fragments I for processing. It is essentially modeled after document, but allowing  multiple nodes. The requirement to not contain ]]> is for SGML compatibility. We F deliberately choose to not enforce it. This makes the parser accept < strictly more documents than a standards-compliant parser. "Always returns Nothing since there'$s no representation for a PI in the  document tree. *Return value is the encoding, if present. 3Internal subset is parsed, but ignored since we don't have data types to  store it.  Internal DOCTYPE subset. We don')t actually parse this; just scan through 8 and look for the end, and store it in a block of text. ,Results are (tag name, attributes, isEmpty) ++  GProcess the first node differently to encode leading whitespace. This  lets us be sure that parseXML is a left inverse to render.  DWhen parsing an element, three things can happen (besides failure): 8 The end tag matches the start tag. This is a Matched. H The end tag does not match, but the element has an end tag that can be B omitted when there is no more content in its parent. This is an F ImplicitLast. In this case, we need to remember the tag name of the 4 end tag that we did find, so as to match it later. H A start tag is found such that it implicitly ends the current element. C This is an ImplicitNext. In this case, we parse and remember the F entire element that comes next, so that it can be inserted after the  element being parsed. HHTML version of document fragment parsing rule It differs only in that  it parses the HTML version of  and returns an . 3Internal subset is parsed, but ignored since we don't have data types to  store it. CReads text and references, up until the passed-in parser succeeds. F (Generally, the passed in parser should be an end tag parser for the  RCDATA element.) @From 8.2.2.3 of the HTML 5 spec, omitting the very high control J characters because they are unlikely to occur and I got tired of typing.  And, the rendering code.  HTML allows & so long as it is not  ambiguous (i.e., looks like an / entity). So we have a special case for that. GProcess the first node differently to encode leading whitespace. This  lets us be sure that  parseHTML is a left inverse to render. *Parses the given XML fragment. +FParses the given HTML fragment. This enables HTML quirks mode, which L changes the parsing algorithm to parse valid HTML 5 documents correctly. , Renders a . -  !"#$%&'()*+,0    !"#$%&'()*+,*+,3-#A zipper for XML document forests. . Retrieves the current node of a - Just the tag of an element  ?Reconstructs an element from a tag and a list of its children. / Builds a -8 for navigating a tree. That is, a forest with a single  root  . 0 Builds a -7 for navigating a forest with the given list of roots. B The cursor is initially positioned at the left-most node. Gives   if the list is empty. 1@Retrieves the root node containing the current cursor position. 2Retrieves the entire forest of  s corresponding to a -. 3Retrieves a list of the  ,s at the same level as the current position * of a cursor, including the current node. 4 Navigates a - to its parent in the document. 5 Navigates a -- up through parents to reach the root level. 6 Navigates a -$ down to the indicated child index. 7 Navigates a - down to its first child. 8 Navigates a - down to its last child. 9Moves a - to its left sibling. :Moves a - to its right sibling. ;Moves a -7 to the next node encountered in a depth-first search. + If it has children, this is equivalent to 7. Otherwise, if it 1 has a right sibling, then this is equivalent to :. Otherwise, the @ cursor moves to the first right sibling of one of its parents.  Repeats the given move until a - is obtained that matches the  predicate.  predicate move starting point < Navigates a -0 to the first child that matches the predicate. = Navigates a -, to the nearest left sibling that matches a  predicate. > Navigates a -8 to the nearest right sibling that matches a predicate. ?IDoes a depth-first search for a descendant matching the predicate. This ( can match the current cursor position. @Determines if the - is at a root node. ADetermines if the - is at a first child. BDetermines if the - is at a last child. CDetermines if the - is at a leaf node. DDetermines if the -0 is at a child node (i.e., if it has a parent). EDetermines if the -( is at a non-leaf node (i.e., if it has  children). FGets the index of the - among its siblings. GReplaces the current node. H2Modifies the current node by applying a function. IAModifies the current node by applying an action in some functor. JInserts a new  & to the left of the current position. KInserts a new  ' to the right of the current position. LInserts a list of new  's to the left of the current position. MInserts a list of new  (s to the right of the current position. N Inserts a  , as the first child of the current element. O Inserts a  + as the last child of the current element. PInserts a list of  0s as the first children of the current element. QInserts a list of  /s as the last children of the current element. RInserts a new  0 to the left of the current position, and moves  left to the new node. SInserts a new  1 to the right of the current position, and moves  right to the new node. T Removes the  . to the left of the current position, if any. U Removes the  / to the right of the current position, if any. VRemoves the current  ,, and moves the Cursor to its left sibling,  if any. WRemoves the current  -, and moves the Cursor to its right sibling,  if any. XRemoves the current  ., and moves the Cursor to its parent, if any. ,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX--./012.3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX,-../0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX  Render a  , to Text. This is only meant to be used for = shorter strings, since it is inefficient for large strings.   Render a   to an appending list of nodes  Render some  to an appending list of nodes Y#Render HTML to an xmlhtml Document YYY    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~6     6 7     xmlhtml-0.1 Text.XmlHtmlText.XmlHtml.CursorText.Blaze.Renderer.XmlHtmlText.XmlHtml.HTML.MetaText.XmlHtml.CommonText.XmlHtml.TextParserText.XmlHtml.XML.ParseText.XmlHtml.XML.RenderText.XmlHtml.HTML.ParseText.XmlHtml.HTML.RenderEncodingUTF16LEUTF16BEUTF8InternalSubsetNoInternalSubset InternalText ExternalID NoExternalIDSystemPublicDocTypeNodeElement elementTag elementAttrselementChildrenCommentTextNodeDocument HtmlDocument XmlDocument docEncodingdocType docContent isTextNode isComment isElementtagName getAttribute hasAttribute setAttributenodeText childNodes childElementschildElementsTagchildElementTagdescendantNodesdescendantElementsdescendantElementsTagdescendantElementTagparseXML parseHTMLrenderCursorcurrentfromNode fromNodestopNodetopNodessiblingsparentrootgetChild firstChild lastChildleftrightnextDF findChildfindLeft findRightfindRecisRootisFirstisLastisLeafisChild hasChildren getNodeIndexsetNode modifyNode modifyNodeM insertLeft insertRightinsertManyLeftinsertManyRightinsertFirstChildinsertLastChildinsertManyFirstChildinsertManyLastChild insertGoLeft insertGoRight removeLeft removeRight removeGoLeft removeGoRight removeGoUp renderHtmlvoidTags rawTextTags rcdataTagsendOmittableLastendOmittableNextpredefinedRefsreftab1reftab2reftab3reftab4reftab5reftab6reftab7reftab8reftab9reftab10reftab11reftab12reftab13reftab14reftab15reftab16reftab17reftab18reftab19reftab20reftab21reftab22reftab23reftab24reftab25reftab26reftab27reftab28reftab29reftab30reftab31reftab32reftab33reftab34reftab35reftab36reftab37reftab38reftab39reftab40reftab41reftab42reftab43reftab44reftab45reftab46reftab47reftab48reftab49reftab50reftab51reftab52reftab53reftab54reftab55reftab56reftab57reftab58base Data.MaybeNothing encodingNameencoder text-0.11.0.5Data.Text.InternalTextbytestring-0.9.1.8Data.ByteString.Internal ByteStringdecoderisUTF16fromText ScanStatescanTextScanFail ScanFinishScanNextParser guessEncodingparse isValidChar parseText takeWhile0ghc-primGHC.BoolTrue takeWhile1textInternalDoctypeState IDSCommentE1 IDSCommentD1 IDSComment IDSCommentS3 IDSCommentS2 IDSCommentS1 IDSInQuote IDSScanningIDSStart docFragment whiteSpaceisNameStartChar isNameCharname attrValue systemLiteral pubIdLiteral isPubIdCharcharDatacommentprocessingInstructionpiTargetcdatacdSectprologxmlDecl versionInfoeqmisc docTypeDeclinternalDoctypesdDeclelementemptyOrStartTag attributeendTagcontentcharRef reference entityRef externalID encodingDeclinternalSubsetsysIDpubIDnode firstNodeescapedentity ElemResult ImplicitNext ImplicitLastMatchedrcdata finishElementattrName isControlCharquotedAttrValueunquotedAttrValue finishCharReffinishEntityRefleftsrightsparentsTagfromTagsearchfromChoiceStringTextblaze-html-0.3.2.1Text.Blaze.Internal ChoiceStringfromChoiceString renderNodesHtml