Socket
Socket
Sign inDemoInstall

hyntax-yx

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.7 to 1.0.8

20

lib-es5/tokenizer-context-handlers/data.js

@@ -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": [

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