Comparing version 2.6.2 to 2.7.0
@@ -713,2 +713,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ltx = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
var STATE_ATTR_VALUE = 8 | ||
var STATE_CDATA = 9 | ||
@@ -774,2 +775,11 @@ var SaxLtx = module.exports = function SaxLtx () { | ||
break | ||
case STATE_CDATA: | ||
if (c === 93 /* ] */ && data.substr(pos + 1, 2) === ']>') { | ||
var cData = endRecording() | ||
if (cData) { | ||
this.emit('text', unescapeXML(cData)) | ||
} | ||
state = STATE_IGNORE_COMMENT | ||
} | ||
break | ||
case STATE_TAG_NAME: | ||
@@ -780,4 +790,9 @@ if (c === 47 /* / */ && recordStart === pos) { | ||
} else if (c === 33 /* ! */) { | ||
recordStart = undefined | ||
state = STATE_IGNORE_COMMENT | ||
if (data.substr(pos + 1, 7) === '[CDATA[') { | ||
recordStart = pos + 8 | ||
state = STATE_CDATA | ||
} else { | ||
recordStart = undefined | ||
state = STATE_IGNORE_COMMENT | ||
} | ||
} else if (c === 63 /* ? */) { | ||
@@ -796,3 +811,4 @@ recordStart = undefined | ||
var prevSecond = data.charCodeAt(pos - 2) | ||
if (prevFirst === 45 /* - */ && prevSecond === 45 /* - */) { | ||
if ((prevFirst === 45 /* - */ && prevSecond === 45 /* - */) || | ||
(prevFirst === 93 /* ] */ && prevSecond === 93 /* ] */)) { | ||
state = STATE_TEXT | ||
@@ -799,0 +815,0 @@ } |
@@ -16,2 +16,3 @@ 'use strict' | ||
var STATE_ATTR_VALUE = 8 | ||
var STATE_CDATA = 9 | ||
@@ -77,2 +78,11 @@ var SaxLtx = module.exports = function SaxLtx () { | ||
break | ||
case STATE_CDATA: | ||
if (c === 93 /* ] */ && data.substr(pos + 1, 2) === ']>') { | ||
var cData = endRecording() | ||
if (cData) { | ||
this.emit('text', unescapeXML(cData)) | ||
} | ||
state = STATE_IGNORE_COMMENT | ||
} | ||
break | ||
case STATE_TAG_NAME: | ||
@@ -83,4 +93,9 @@ if (c === 47 /* / */ && recordStart === pos) { | ||
} else if (c === 33 /* ! */) { | ||
recordStart = undefined | ||
state = STATE_IGNORE_COMMENT | ||
if (data.substr(pos + 1, 7) === '[CDATA[') { | ||
recordStart = pos + 8 | ||
state = STATE_CDATA | ||
} else { | ||
recordStart = undefined | ||
state = STATE_IGNORE_COMMENT | ||
} | ||
} else if (c === 63 /* ? */) { | ||
@@ -99,3 +114,4 @@ recordStart = undefined | ||
var prevSecond = data.charCodeAt(pos - 2) | ||
if (prevFirst === 45 /* - */ && prevSecond === 45 /* - */) { | ||
if ((prevFirst === 45 /* - */ && prevSecond === 45 /* - */) || | ||
(prevFirst === 93 /* ] */ && prevSecond === 93 /* ] */)) { | ||
state = STATE_TEXT | ||
@@ -102,0 +118,0 @@ } |
{ | ||
"name": "ltx", | ||
"version": "2.6.2", | ||
"version": "2.7.0", | ||
"description": "<xml for=\"JavaScript\">", | ||
@@ -18,3 +18,2 @@ "author": "Astro", | ||
"license": "MIT", | ||
"engine": "node", | ||
"scripts": { | ||
@@ -24,3 +23,3 @@ "prepublish": "npm run bundle", | ||
"benchmark": "node benchmarks/", | ||
"bundle": "browserify -s ltx index.js -o bundle.js", | ||
"bundle": "browserify -s ltx index.js -o bundle.js && cp bundle.js dist/ltx.js", | ||
"unit": "vows --spec", | ||
@@ -34,12 +33,12 @@ "lint": "standard", | ||
"devDependencies": { | ||
"benchmark": "^2.1.0", | ||
"browserify": "^13.0.1", | ||
"libxmljs": "^0.18.0", | ||
"benchmark": "^2.1.3", | ||
"browserify": "^14.1.0", | ||
"libxmljs": "^0.18.4", | ||
"microtime": "^2.1.2", | ||
"node-expat": "^2.3.13", | ||
"node-xml": "^1.0.2", | ||
"sax": "^1.1.5", | ||
"standard": "^8.5.0", | ||
"sax": "^1.2.2", | ||
"standard": "^9.0.0", | ||
"vows": "^0.8.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
173580
26
3293
6