@markuplint/svelte-parser 4.0.0-alpha.8 → 4.0.0-alpha.9
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/lib/attr.js +1 -6
- package/lib/directive-tokenizer.d.ts +1 -1
- package/lib/directive-tokenizer.js +1 -1
- package/lib/nodeize.js +2 -1
- package/package.json +5 -5
package/lib/attr.js
CHANGED
|
@@ -26,12 +26,7 @@ attr, rawHTML) {
|
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
const { raw, startLine, startCol, startOffset } = sliceFragment(rawHTML, start, end);
|
|
29
|
-
|
|
30
|
-
? attr.name
|
|
31
|
-
: attr.expression && 'start' in attr.expression && 'end' in attr.expression
|
|
32
|
-
? sliceFragment(rawHTML, attr.expression.start, attr.expression.end).raw
|
|
33
|
-
: '';
|
|
34
|
-
token = directiveTokenizer(raw, valueToken, startLine, startCol, startOffset);
|
|
29
|
+
token = directiveTokenizer(raw, startLine, startCol, startOffset);
|
|
35
30
|
}
|
|
36
31
|
if (!specificBindDirective.has(token.name.raw) && /^bind:/i.test(token.name.raw)) {
|
|
37
32
|
// Remove "bind:"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { MLASTHTMLAttr } from '@markuplint/ml-ast';
|
|
2
|
-
export declare function directiveTokenizer(raw: string,
|
|
2
|
+
export declare function directiveTokenizer(raw: string, line: number, col: number, startOffset: number): MLASTHTMLAttr;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttrState, attrTokenizer } from '@markuplint/parser-utils';
|
|
2
|
-
export function directiveTokenizer(raw,
|
|
2
|
+
export function directiveTokenizer(raw, line, col, startOffset) {
|
|
3
3
|
const nameOnly = raw.trim().startsWith('{') && raw.trim().endsWith('}');
|
|
4
4
|
const directiveToken = attrTokenizer(raw, line, col, startOffset, [
|
|
5
5
|
{ start: '"', end: '"' },
|
package/lib/nodeize.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getNamespace } from '@markuplint/html-parser';
|
|
2
2
|
import { detectElementType, sliceFragment, uuid, tagParser } from '@markuplint/parser-utils';
|
|
3
3
|
import { attr } from './attr.js';
|
|
4
|
+
import { directiveTokenizer } from './directive-tokenizer.js';
|
|
4
5
|
import { parseCtrlBlock } from './parse-ctrl-block.js';
|
|
5
6
|
import { traverse } from './traverse.js';
|
|
6
7
|
export function nodeize(
|
|
@@ -96,7 +97,7 @@ parentNode, rawHtml, options) {
|
|
|
96
97
|
const directives = originNode.attributes.map(a => attr(a, rawHtml)) ?? [];
|
|
97
98
|
const attributes = directives.filter((d) => !('__spreadAttr' in d));
|
|
98
99
|
const hasSpreadAttr = directives.some(d => '__spreadAttr' in d);
|
|
99
|
-
const tagTokens = tagParser(startTagLocation.raw, startTagLocation.startLine, startTagLocation.startCol, startTagLocation.startOffset);
|
|
100
|
+
const tagTokens = tagParser(startTagLocation.raw, startTagLocation.startLine, startTagLocation.startCol, startTagLocation.startOffset, undefined, undefined, undefined, undefined, directiveTokenizer);
|
|
100
101
|
const namespace = getNamespace(originNode.name, parentNamespace);
|
|
101
102
|
const startTag = {
|
|
102
103
|
uuid: uuid(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/svelte-parser",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.9",
|
|
4
4
|
"description": "Svelte parser for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"clean": "tsc --build --clean"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@markuplint/html-parser": "4.0.0-alpha.
|
|
28
|
-
"@markuplint/ml-ast": "4.0.0-alpha.
|
|
29
|
-
"@markuplint/parser-utils": "4.0.0-alpha.
|
|
27
|
+
"@markuplint/html-parser": "4.0.0-alpha.9",
|
|
28
|
+
"@markuplint/ml-ast": "4.0.0-alpha.9",
|
|
29
|
+
"@markuplint/parser-utils": "4.0.0-alpha.9",
|
|
30
30
|
"svelte": "^4.2.8"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "c86b754700aaf61b561a64dbd0c87424e772f619"
|
|
33
33
|
}
|