hyntax-yx
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -114,10 +114,18 @@ "use strict"; | ||
return openingCornerBraceWithSlash(state, tokens); | ||
} | ||
} // 这种方法不行,会误伤属性里的<,如<dd class="1<5">1<5</dd> <view>我是打酱油</view> | ||
// if (chars === '<') { | ||
// const restChars = fullChars ? fullChars.slice(charIndex + 1) : '' | ||
// if (nextChar !== '!' && restChars.indexOf('>') == -1) { | ||
// // 1 < 5 后面没有其他的 > ,则 当前 < 不是标签 | ||
// } else if (nextChar !== '!' && restChars.indexOf('<') > -1 && restChars.indexOf('<') < restChars.indexOf('>')) { | ||
// // <div> a < 1 </div> 如果 < 后面先出现 < 后出现 > 就代表当前的 < 不是标签 | ||
// } else { | ||
// state.caretPosition++ | ||
// return | ||
// } | ||
// } | ||
if (chars === '<') { | ||
var restChars = fullChars ? fullChars.slice(charIndex + 1) : ''; | ||
if (nextChar !== '!' && restChars.indexOf('>') == -1) {// 1 < 5 后面没有其他的 > ,则 当前 < 不是标签 | ||
} else if (nextChar !== '!' && restChars.indexOf('<') > -1 && restChars.indexOf('<') < restChars.indexOf('>')) {// <div> a < 1 </div> 如果 < 后面先出现 < 后出现 > 就代表当前的 < 不是标签 | ||
} else { | ||
if (nextNoWhiteChar.match(/[a-z]|[A-Z]|\/|\!|\-/)) { | ||
state.caretPosition++; | ||
@@ -124,0 +132,0 @@ return; |
@@ -123,11 +123,19 @@ const { calculateTokenCharactersRange } = require('../helpers') | ||
// 这种方法不行,会误伤属性里的<,如<dd class="1<5">1<5</dd> <view>我是打酱油</view> | ||
// if (chars === '<') { | ||
// const restChars = fullChars ? fullChars.slice(charIndex + 1) : '' | ||
// if (nextChar !== '!' && restChars.indexOf('>') == -1) { | ||
// // 1 < 5 后面没有其他的 > ,则 当前 < 不是标签 | ||
// } else if (nextChar !== '!' && restChars.indexOf('<') > -1 && restChars.indexOf('<') < restChars.indexOf('>')) { | ||
// // <div> a < 1 </div> 如果 < 后面先出现 < 后出现 > 就代表当前的 < 不是标签 | ||
// } else { | ||
// state.caretPosition++ | ||
// return | ||
// } | ||
// } | ||
if (chars === '<') { | ||
const restChars = fullChars ? fullChars.slice(charIndex + 1) : '' | ||
if (nextChar !== '!' && restChars.indexOf('>') == -1) { | ||
// 1 < 5 后面没有其他的 > ,则 当前 < 不是标签 | ||
} else if (nextChar !== '!' && restChars.indexOf('<') > -1 && restChars.indexOf('<') < restChars.indexOf('>')) { | ||
// <div> a < 1 </div> 如果 < 后面先出现 < 后出现 > 就代表当前的 < 不是标签 | ||
} else { | ||
if (nextNoWhiteChar.match(/[a-z]|[A-Z]|\/|\!|\-/)) { | ||
state.caretPosition++ | ||
return | ||
@@ -134,0 +142,0 @@ } |
{ | ||
"name": "hyntax-yx", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Straightforward HTML parser for Node.js and browser", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
921158
4165