- This situation can easily happen when piping a socket to the saxStream and the socket is disconnected before receiving any data. - Add a simple test.
When sending Buffers to the stream interface, check whether the chunk ends with an incomplete multi-byte sequence. If it does, then strip it off and add to the beginning of the next chunk. If the stream ends with an incomplete sequence, pass it through unchanged. Using the Buffer global here should be OK, as the stream interface should only be being used in a Node.JS environment.
Was using hasOwnProperty(), when actually what was intended was indexOf() not equal to -1. This breaks if you had an attribute named 'length'. Close #98 Close #99 Test authored by @michaelnisi (who also found the bug)
Scripts can contain tag characters within their bounds (string, templates, etc). These characters should not cause the script tag to appear closed. Wait for an actual script tag closure. Note that the presence of the full string "</script>" within the tag will still cause termination as no checking for quotes or other specifics is done. This just expands the termination check slightly.
The XML spec defines processing instructions as: PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) ( http://www.w3.org/TR/REC-xml/#sec-pi ) This does not require quotes inside the processing instruction to match. The code, however, was entering and exiting a special state (PROC_INST_QUOTED) for quotes as it hit them. This caused it to incorrectly error out on unmatched quotes. This commit removes PROC_INST_QUOTED.