Socket
Socket
Sign inDemoInstall

sax

Package Overview
Dependencies
Maintainers
0
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sax - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

test/unquoted.js

43

lib/sax.js

@@ -55,7 +55,11 @@ // wrapper for non-node envs

switch (buffers[i]) {
case "textNode": closeText(parser) ; break
case "textNode":
closeText(parser)
break
case "cdata":
emitNode(parser, "oncdata", parser.cdata)
parser.cdata = ""
break
break
default:

@@ -377,2 +381,3 @@ error(parser, "Max buffer length exceeded: "+buffers[i])

switch (parser.state) {
case S.BEGIN:

@@ -388,2 +393,3 @@ if (c === "<") parser.state = S.OPEN_WAKA

continue
case S.TEXT:

@@ -412,2 +418,3 @@ if (parser.sawRoot && !parser.closedRoot) {

continue
case S.OPEN_WAKA:

@@ -435,2 +442,3 @@ // either a /, ?, !, or text is coming next.

continue
case S.SGML_DECL:

@@ -461,2 +469,3 @@ if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {

continue
case S.SGML_DECL_QUOTED:

@@ -469,2 +478,3 @@ if (c === parser.q) {

continue
case S.DOCTYPE:

@@ -484,2 +494,3 @@ if (c === ">") {

continue
case S.DOCTYPE_QUOTED:

@@ -492,2 +503,3 @@ parser.doctype += c

continue
case S.DOCTYPE_DTD:

@@ -501,2 +513,3 @@ parser.doctype += c

continue
case S.DOCTYPE_DTD_QUOTED:

@@ -509,2 +522,3 @@ parser.doctype += c

continue
case S.COMMENT:

@@ -514,2 +528,3 @@ if (c === "-") parser.state = S.COMMENT_ENDING

continue
case S.COMMENT_ENDING:

@@ -526,2 +541,3 @@ if (c === "-") {

continue
case S.COMMENT_ENDED:

@@ -531,2 +547,3 @@ if (c !== ">") strictFail(parser, "Malformed comment")

continue
case S.CDATA:

@@ -536,2 +553,3 @@ if (c === "]") parser.state = S.CDATA_ENDING

continue
case S.CDATA_ENDING:

@@ -544,2 +562,3 @@ if (c === "]") parser.state = S.CDATA_ENDING_2

continue
case S.CDATA_ENDING_2:

@@ -558,2 +577,3 @@ if (c === ">") {

continue
case S.PROC_INST:

@@ -564,2 +584,3 @@ if (c === "?") parser.state = S.PROC_INST_ENDING

continue
case S.PROC_INST_BODY:

@@ -574,2 +595,3 @@ if (!parser.procInstBody && is(whitespace, c)) continue

continue
case S.PROC_INST_ENDING:

@@ -588,2 +610,3 @@ if (c === ">") {

continue
case S.PROC_INST_QUOTED:

@@ -596,2 +619,3 @@ parser.procInstBody += c

continue
case S.OPEN_TAG:

@@ -610,2 +634,3 @@ if (is(nameBody, c)) parser.tagName += c

continue
case S.OPEN_TAG_SLASH:

@@ -620,2 +645,3 @@ if (c === ">") {

continue
case S.ATTRIB:

@@ -632,2 +658,3 @@ // haven't read the attribute name yet.

continue
case S.ATTRIB_NAME:

@@ -639,2 +666,3 @@ if (c === "=") parser.state = S.ATTRIB_VALUE

continue
case S.ATTRIB_NAME_SAW_WHITE:

@@ -660,2 +688,3 @@ if (c === "=") parser.state = S.ATTRIB_VALUE

continue
case S.ATTRIB_VALUE:

@@ -672,2 +701,3 @@ if (is(whitespace, c)) continue

continue
case S.ATTRIB_VALUE_QUOTED:

@@ -686,2 +716,3 @@ if (c !== parser.q) {

continue
case S.ATTRIB_VALUE_UNQUOTED:

@@ -693,2 +724,3 @@ if (not(whitespace+">",c)) {

}
parser.tag.attributes[parser.attribName] = parser.attribValue
emitNode(parser, "onattribute",

@@ -700,2 +732,3 @@ { name: parser.attribName, value: parser.attribValue})

continue
case S.CLOSE_TAG:

@@ -716,2 +749,3 @@ if (!parser.tagName) {

continue
case S.CLOSE_TAG_SAW_WHITE:

@@ -722,2 +756,3 @@ if (is(whitespace, c)) continue

continue
case S.TEXT_ENTITY:

@@ -730,5 +765,7 @@ case S.ATTRIB_VALUE_ENTITY_Q:

break
case S.ATTRIB_VALUE_ENTITY_Q:
var returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"
break
case S.ATTRIB_VALUE_ENTITY_U:

@@ -751,5 +788,5 @@ var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"

continue
default:
throw new Error(parser, "Unknown state: " + parser.state)
break
}

@@ -756,0 +793,0 @@ } // while

2

package.json
{ "name" : "sax"
, "author" : "Isaac Z. Schlueter <i@izs.me>"
, "version" : "0.2.1"
, "version" : "0.2.2"
, "main" : "lib/sax"

@@ -5,0 +5,0 @@ , "license" : "MIT"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc