Socket
Socket
Sign inDemoInstall

sax

Package Overview
Dependencies
0
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.4.0

40

lib/sax.js

@@ -74,2 +74,8 @@ ;(function (sax) { // wrapper for non-node envs

// disallow unquoted attribute values if not otherwise configured
// and strict mode is true
if (parser.opt.unquotedAttributeValues === undefined) {
parser.opt.unquotedAttributeValues = !strict;
}
// mostly just for error reporting

@@ -1094,2 +1100,14 @@ parser.trackPosition = parser.opt.position !== false

case S.SGML_DECL:
if (parser.sgmlDecl + c === '--') {
parser.state = S.COMMENT
parser.comment = ''
parser.sgmlDecl = ''
continue;
}
if (parser.doctype && parser.doctype !== true) {
parser.sgmlDecl += c
continue;
}
if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {

@@ -1100,6 +1118,2 @@ emitNode(parser, 'onopencdata')

parser.cdata = ''
} else if (parser.sgmlDecl + c === '--') {
parser.state = S.COMMENT
parser.comment = ''
parser.sgmlDecl = ''
} else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {

@@ -1158,6 +1172,10 @@ parser.state = S.DOCTYPE

case S.DOCTYPE_DTD:
parser.doctype += c
if (c === ']') {
parser.doctype += c
parser.state = S.DOCTYPE
} else if (c === '<') {
parser.state = S.OPEN_WAKA
parser.startTagPosition = parser.position
} else if (isQuote(c)) {
parser.doctype += c
parser.state = S.DOCTYPE_DTD_QUOTED

@@ -1205,2 +1223,4 @@ parser.q = c

parser.state = S.COMMENT
} else if (parser.doctype && parser.doctype !== true) {
parser.state = S.DOCTYPE_DTD
} else {

@@ -1373,3 +1393,5 @@ parser.state = S.TEXT

} else {
strictFail(parser, 'Unquoted attribute value')
if (!parser.opt.unquotedAttributeValues) {
error(parser, 'Unquoted attribute value')
}
parser.state = S.ATTRIB_VALUE_UNQUOTED

@@ -1492,4 +1514,4 @@ parser.attribValue = c

if (c === ';') {
if (parser.opt.unparsedEntities) {
var parsedEntity = parseEntity(parser)
var parsedEntity = parseEntity(parser)
if (parser.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) {
parser.entity = ''

@@ -1499,3 +1521,3 @@ parser.state = returnState

} else {
parser[buffer] += parseEntity(parser)
parser[buffer] += parsedEntity
parser.entity = ''

@@ -1502,0 +1524,0 @@ parser.state = returnState

@@ -5,3 +5,3 @@ {

"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"version": "1.3.0",
"version": "1.4.0",
"main": "lib/sax.js",

@@ -8,0 +8,0 @@ "license": "ISC",

@@ -109,2 +109,5 @@ # sax js

(`&amp;`, `&apos;`, `&gt;`, `&lt;`, and `&quot;`)
* `unquotedAttributeValues` - Boolean. If true, then unquoted
attribute values are allowed. Defaults to `false` when `strict`
is true, `true` otherwise.

@@ -111,0 +114,0 @@ ## Methods

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc