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

tree-sitter-html

Package Overview
Dependencies
Maintainers
9
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sitter-html - npm Package Compare versions

Comparing version 0.19.0 to 0.20.0

.eslintrc.js

8

bindings/node/index.js
try {
module.exports = require("../../build/Release/tree_sitter_html_binding");
module.exports = require('../../build/Release/tree_sitter_html_binding');
} catch (error1) {

@@ -8,3 +8,3 @@ if (error1.code !== 'MODULE_NOT_FOUND') {

try {
module.exports = require("../../build/Debug/tree_sitter_html_binding");
module.exports = require('../../build/Debug/tree_sitter_html_binding');
} catch (error2) {

@@ -14,3 +14,3 @@ if (error2.code !== 'MODULE_NOT_FOUND') {

}
throw error1
throw error1;
}

@@ -20,3 +20,3 @@ }

try {
module.exports.nodeTypeInfo = require("../../src/node-types.json");
module.exports.nodeTypeInfo = require('../../src/node-types.json');
} catch (_) {}

@@ -0,1 +1,13 @@

/**
* @file HTML grammar for tree-sitter
* @author Max Brunsfeld
* @license MIT
*/
/* eslint-disable arrow-parens */
/* eslint-disable camelcase */
/* eslint-disable-next-line spaced-comment */
/// <reference types="tree-sitter-cli/dsl" />
// @ts-check
module.exports = grammar({

@@ -28,9 +40,10 @@ name: 'html',

/[^>]+/,
'>'
'>',
),
_doctype: $ => /[Dd][Oo][Cc][Tt][Yy][Pp][Ee]/,
_doctype: _ => /[Dd][Oo][Cc][Tt][Yy][Pp][Ee]/,
_node: $ => choice(
$.doctype,
$.entity,
$.text,

@@ -40,3 +53,3 @@ $.element,

$.style_element,
$.erroneous_end_tag
$.erroneous_end_tag,
),

@@ -48,5 +61,5 @@

repeat($._node),
choice($.end_tag, $._implicit_end_tag)
choice($.end_tag, $._implicit_end_tag),
),
$.self_closing_tag
$.self_closing_tag,
),

@@ -57,3 +70,3 @@

optional($.raw_text),
$.end_tag
$.end_tag,
),

@@ -64,3 +77,3 @@

optional($.raw_text),
$.end_tag
$.end_tag,
),

@@ -72,3 +85,3 @@

repeat($.attribute),
'>'
'>',
),

@@ -80,3 +93,3 @@

repeat($.attribute),
'>'
'>',
),

@@ -88,3 +101,3 @@

repeat($.attribute),
'>'
'>',
),

@@ -96,3 +109,3 @@

repeat($.attribute),
'/>'
'/>',
),

@@ -103,3 +116,3 @@

alias($._end_tag_name, $.tag_name),
'>'
'>',
),

@@ -110,3 +123,3 @@

$.erroneous_end_tag_name,
'>'
'>',
),

@@ -120,18 +133,23 @@

$.attribute_value,
$.quoted_attribute_value
)
))
$.quoted_attribute_value,
),
)),
),
attribute_name: $ => /[^<>"'/=\s]+/,
attribute_name: _ => /[^<>"'/=\s]+/,
attribute_value: $ => /[^<>"'=\s]+/,
attribute_value: _ => /[^<>"'=\s]+/,
// An entity can be named, numeric (decimal), or numeric (hexacecimal). The
// longest entity name is 29 characters long, and the HTML spec says that
// no more will ever be added.
entity: _ => /&(#([xX][0-9a-fA-F]{1,6}|[0-9]{1,5})|[A-Za-z]{1,30});/,
quoted_attribute_value: $ => choice(
seq("'", optional(alias(/[^']+/, $.attribute_value)), "'"),
seq('"', optional(alias(/[^"]+/, $.attribute_value)), '"')
seq('\'', optional(alias(/[^']+/, $.attribute_value)), '\''),
seq('"', optional(alias(/[^"]+/, $.attribute_value)), '"'),
),
text: $ => /[^<>]+/
}
text: _ => /[^<>&\s]([^<>&]*[^<>&\s])?/,
},
});
{
"name": "tree-sitter-html",
"version": "0.19.0",
"version": "0.20.0",
"description": "HTML grammar for tree-sitter",

@@ -10,14 +10,27 @@ "main": "bindings/node",

],
"homepage": "https://github.com/tree-sitter/tree-sitter-html",
"repository": {
"type": "git",
"url": "https://github.com/tree-sitter/tree-sitter-html.git"
},
"bugs": {
"url": "https://github.com/tree-sitter/tree-sitter-html/issues"
},
"authors": [
"Max Brunsfeld <maxbrunsfeld@gmail.com>",
"Ashi Krishnan <queerviolet@github.com>"
"Ashi Krishnan <queerviolet@github.com>",
"Amaan Qureshi <amaanq12@gmail.com>"
],
"license": "MIT",
"dependencies": {
"nan": "^2.14.0"
"nan": "^2.18.0"
},
"devDependencies": {
"tree-sitter-cli": "^0.19.1"
"eslint": "^8.50.0",
"eslint-config-google": "^0.14.0",
"tree-sitter-cli": "^0.20.8"
},
"scripts": {
"build": "tree-sitter generate && node-gyp build",
"lint": "eslint grammar.js",
"test": "tree-sitter test && tree-sitter parse examples/*.html --quiet --time",

@@ -32,5 +45,11 @@ "test-windows": "tree-sitter test"

],
"injection-regex": "html"
"injection-regex": "html",
"highlights": [
"queries/highlights.scm"
],
"injections": [
"queries/injections.scm"
]
}
]
}

@@ -1,13 +0,9 @@

tree-sitter-html
================
# tree-sitter-html
[![Build Status](https://travis-ci.org/tree-sitter/tree-sitter-html.svg?branch=master)](https://travis-ci.org/tree-sitter/tree-sitter-html)
[![Build status](https://ci.appveyor.com/api/projects/status/bv1i8f3yi2aoyonx/branch/master?svg=true)](https://ci.appveyor.com/project/maxbrunsfeld/tree-sitter-html/branch/master)
[![build](https://github.com/tree-sitter/tree-sitter-html/actions/workflows/ci.yml/badge.svg)](https://github.com/tree-sitter/tree-sitter-html/actions/workflows/ci.yml)
HTML grammar for [tree-sitter][].
HTML grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
[tree-sitter]: https://github.com/tree-sitter/tree-sitter
References
* [The HTML5 Spec](https://www.w3.org/TR/html5/syntax.html)

@@ -50,2 +50,6 @@ {

"type": "SYMBOL",
"name": "entity"
},
{
"type": "SYMBOL",
"name": "text"

@@ -371,2 +375,6 @@ },

},
"entity": {
"type": "PATTERN",
"value": "&(#([xX][0-9a-fA-F]{1,6}|[0-9]{1,5})|[A-Za-z]{1,30});"
},
"quoted_attribute_value": {

@@ -439,3 +447,3 @@ "type": "CHOICE",

"type": "PATTERN",
"value": "[^<>]+"
"value": "[^<>&\\s]([^<>&]*[^<>&\\s])?"
}

@@ -442,0 +450,0 @@ },

@@ -51,2 +51,6 @@ [

{
"type": "entity",
"named": true
},
{
"type": "erroneous_end_tag",

@@ -125,2 +129,6 @@ "named": true

{
"type": "entity",
"named": true
},
{
"type": "erroneous_end_tag",

@@ -292,2 +300,6 @@ "named": true

{
"type": "entity",
"named": true
},
{
"type": "erroneous_end_tag_name",

@@ -294,0 +306,0 @@ "named": true

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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