@markuplint/pug-parser 4.6.11 → 4.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/parser.d.ts +1 -0
- package/lib/parser.js +10 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.6.12](https://github.com/markuplint/markuplint/compare/@markuplint/pug-parser@4.6.11...@markuplint/pug-parser@4.6.12) (2024-10-31)
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
- **pug-parser:** prevent redundant recursive parsing ([d883826](https://github.com/markuplint/markuplint/commit/d883826d25745a31f45e5ba7cde1dfa8f32a358c))
|
|
11
|
+
- **pug-parser:** return null in `visitSpreadAttr` for Pug, as the method is unnecessary ([56e0d61](https://github.com/markuplint/markuplint/commit/56e0d61e370872a4328ff3e70a89947bc6fbcf7a))
|
|
12
|
+
|
|
6
13
|
## [4.6.11](https://github.com/markuplint/markuplint/compare/@markuplint/pug-parser@4.6.10...@markuplint/pug-parser@4.6.11) (2024-10-28)
|
|
7
14
|
|
|
8
15
|
**Note:** Version bump only for package @markuplint/pug-parser
|
package/lib/parser.d.ts
CHANGED
package/lib/parser.js
CHANGED
|
@@ -62,6 +62,13 @@ class PugParser extends Parser {
|
|
|
62
62
|
if (originNode.raw.trim() === '') {
|
|
63
63
|
return [];
|
|
64
64
|
}
|
|
65
|
+
if (!originNode.raw.includes('<') && !originNode.raw.includes('#[')) {
|
|
66
|
+
return this.visitText({
|
|
67
|
+
...token,
|
|
68
|
+
depth,
|
|
69
|
+
parentNode,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
65
72
|
const htmlDoc = new HtmlInPugParser().parse(originNode.raw, {
|
|
66
73
|
offsetOffset: originNode.offset,
|
|
67
74
|
offsetLine: originNode.line,
|
|
@@ -199,6 +206,9 @@ class PugParser extends Parser {
|
|
|
199
206
|
const siblings = this.visitChildren(childNodes, startTag);
|
|
200
207
|
return [startTag, ...siblings];
|
|
201
208
|
}
|
|
209
|
+
visitSpreadAttr() {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
202
212
|
visitAttr(token) {
|
|
203
213
|
if (token.raw[0] === '#' || token.raw[0] === '.') {
|
|
204
214
|
const attr = super.visitAttr(token, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/pug-parser",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.12",
|
|
4
4
|
"description": "Pug parser for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"clean": "tsc --build --clean"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@markuplint/html-parser": "4.6.
|
|
24
|
+
"@markuplint/html-parser": "4.6.12",
|
|
25
25
|
"@markuplint/ml-ast": "4.4.8",
|
|
26
|
-
"@markuplint/parser-utils": "4.
|
|
26
|
+
"@markuplint/parser-utils": "4.8.0",
|
|
27
27
|
"pug-lexer": "5.0.1",
|
|
28
28
|
"pug-parser": "6.0.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "c35e0beb5e14093a41cee7634221dbe7f7d577f9"
|
|
31
31
|
}
|