Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lezer/html

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lezer/html - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

src/.tern-port

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.16.1 (2022-05-16)
### Bug fixes
Fix a bug where comment end tokens preceded by dashes were sometimes not recognized.
## 0.16.0 (2022-04-20)

@@ -2,0 +8,0 @@

17

dist/index.es.js

@@ -93,3 +93,3 @@ import { ContextTracker, ExternalTokenizer, LRParser } from '@lezer/lr';

const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33;
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33, dash = 45;

@@ -153,3 +153,3 @@ function ElementContext(name, parent) {

const commentContent = new ExternalTokenizer(input => {
for (let endPos = 0, i = 0;; i++) {
for (let dashes = 0, i = 0;; i++) {
if (input.next < 0) {

@@ -159,10 +159,9 @@ if (i) input.acceptToken(commentContent$1);

}
if (input.next == "-->".charCodeAt(endPos)) {
endPos++;
if (endPos == 3) {
if (i > 3) input.acceptToken(commentContent$1, -2);
break
}
if (input.next == dash) {
dashes++;
} else if (input.next == greaterThan && dashes >= 2) {
if (i > 3) input.acceptToken(commentContent$1, -2);
break
} else {
endPos = 0;
dashes = 0;
}

@@ -169,0 +168,0 @@ input.advance();

{
"name": "@lezer/html",
"version": "0.16.0",
"version": "0.16.1",
"description": "lezer-based HTML grammar",

@@ -5,0 +5,0 @@ "main": "dist/index.cjs",

@@ -72,3 +72,3 @@ /* Hand-written tokenizers for HTML. */

const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33, dash = 45

@@ -132,3 +132,3 @@ function ElementContext(name, parent) {

export const commentContent = new ExternalTokenizer(input => {
for (let endPos = 0, i = 0;; i++) {
for (let dashes = 0, i = 0;; i++) {
if (input.next < 0) {

@@ -138,10 +138,9 @@ if (i) input.acceptToken(cmntContent)

}
if (input.next == "-->".charCodeAt(endPos)) {
endPos++
if (endPos == 3) {
if (i > 3) input.acceptToken(cmntContent, -2)
break
}
if (input.next == dash) {
dashes++
} else if (input.next == greaterThan && dashes >= 2) {
if (i > 3) input.acceptToken(cmntContent, -2)
break
} else {
endPos = 0
dashes = 0
}

@@ -148,0 +147,0 @@ input.advance()

Sorry, the diff of this file is not supported yet

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