@markuplint/vue-parser 4.0.0-alpha.4 → 4.0.0-alpha.6
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/LICENSE +1 -1
- package/lib/parse.js +5 -6
- package/lib/vue-parser/index.d.ts +1 -1
- package/lib/vue-parser/index.js +1 -1
- package/package.json +5 -5
package/LICENSE
CHANGED
package/lib/parse.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { flattenNodes, getEndCol, getEndLine, uuid, ParserError, detectElementType } from '@markuplint/parser-utils';
|
|
1
|
+
import { flattenNodes, getEndCol, getEndLine, uuid, ParserError, detectElementType, tagParser, } from '@markuplint/parser-utils';
|
|
3
2
|
import { attr } from './attr.js';
|
|
4
|
-
import vueParse from './vue-parser/index.js';
|
|
3
|
+
import { vueParse } from './vue-parser/index.js';
|
|
5
4
|
export const parse = (rawCode, options) => {
|
|
6
5
|
let ast;
|
|
7
6
|
try {
|
|
@@ -161,13 +160,13 @@ comments, options) {
|
|
|
161
160
|
default: {
|
|
162
161
|
const tagLoc = originNode.startTag;
|
|
163
162
|
const startTagRaw = rawHtml.slice(tagLoc.range[0], tagLoc.range[1]);
|
|
164
|
-
const tagTokens =
|
|
163
|
+
const tagTokens = tagParser(startTagRaw, startLine, startCol, startOffset);
|
|
165
164
|
const tagName = tagTokens.tagName;
|
|
166
165
|
let endTag = null;
|
|
167
166
|
const endTagLoc = originNode.endTag;
|
|
168
167
|
if (endTagLoc) {
|
|
169
168
|
const endTagRaw = rawHtml.slice(endTagLoc.range[0], endTagLoc.range[1]);
|
|
170
|
-
const endTagTokens =
|
|
169
|
+
const endTagTokens = tagParser(endTagRaw, endTagLoc.loc.start.line, endTagLoc.loc.start.column, endTagLoc.range[0]);
|
|
171
170
|
const endTagName = endTagTokens.tagName;
|
|
172
171
|
endTag = {
|
|
173
172
|
uuid: uuid(),
|
|
@@ -227,7 +226,7 @@ comments, options) {
|
|
|
227
226
|
nextNode,
|
|
228
227
|
pearNode: endTag,
|
|
229
228
|
selfClosingSolidus: tagTokens.selfClosingSolidus,
|
|
230
|
-
endSpace: tagTokens.
|
|
229
|
+
endSpace: tagTokens.afterAttrSpaces,
|
|
231
230
|
isFragment: false,
|
|
232
231
|
isGhost: false,
|
|
233
232
|
tagOpenChar: '<',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as VueESLintParser from 'vue-eslint-parser';
|
|
2
2
|
export type VueTokens = VueESLintParser.AST.ESLintProgram;
|
|
3
|
-
export
|
|
3
|
+
export declare function vueParse(vueTemplate: string): VueTokens;
|
|
4
4
|
export type ASTNode = VueESLintParser.AST.VElement | VueESLintParser.AST.VText | VueESLintParser.AST.VExpressionContainer;
|
|
5
5
|
export type ASTComment = VueESLintParser.AST.Token & VueESLintParser.AST.HasLocation;
|
package/lib/vue-parser/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/vue-parser",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.6",
|
|
4
4
|
"description": "Vue parser for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"clean": "tsc --build --clean"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@markuplint/html-parser": "4.0.0-alpha.
|
|
25
|
-
"@markuplint/ml-ast": "4.0.0-alpha.
|
|
26
|
-
"@markuplint/parser-utils": "4.0.0-alpha.
|
|
24
|
+
"@markuplint/html-parser": "4.0.0-alpha.6",
|
|
25
|
+
"@markuplint/ml-ast": "4.0.0-alpha.6",
|
|
26
|
+
"@markuplint/parser-utils": "4.0.0-alpha.6",
|
|
27
27
|
"vue-eslint-parser": "^9.3.1"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "06e1242d274c72cf08a10a572b06ac35d1b924a4"
|
|
30
30
|
}
|