@markuplint/svelte-parser 4.0.0-dev.10 → 4.0.0-dev.20

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/nodeize.js CHANGED
@@ -190,7 +190,7 @@ parentNode, rawHtml, options) {
190
190
  }
191
191
  }
192
192
  // eslint-disable-next-line regexp/strict
193
- const reEndTag = /{\/await}$/i;
193
+ const reEndTag = /{\s*\/await\s*}$/i;
194
194
  let endTag = null;
195
195
  if (reEndTag.test(raw)) {
196
196
  const endTagRawMatched = raw.match(reEndTag);
@@ -14,7 +14,7 @@ nextNode, options) {
14
14
  }
15
15
  const children = originNode.children ?? [];
16
16
  // eslint-disable-next-line regexp/strict
17
- const reEndTag = /{\/each}$/i;
17
+ const reEndTag = /{\s*\/each\s*}$/i;
18
18
  const startTagEndOffset = children.length > 0 ? children[0]?.start ?? 0 : raw.replace(reEndTag, '').length + startOffset;
19
19
  const startTagLocation = sliceFragment(rawHtml, startOffset, startTagEndOffset);
20
20
  const tag = {
@@ -141,7 +141,8 @@ nextNode, options) {
141
141
  if (originNode.elseif) {
142
142
  return [tag, ...elseOrElseIfTags];
143
143
  }
144
- const endTagRawMatched = raw.match('{/if}');
144
+ // eslint-disable-next-line regexp/strict
145
+ const endTagRawMatched = raw.match(/{\s*\/if\s*}/);
145
146
  if (!endTagRawMatched) {
146
147
  throw new Error('Missing the end token `{/if}`');
147
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/svelte-parser",
3
- "version": "4.0.0-dev.10+b28398ab",
3
+ "version": "4.0.0-dev.20+6b35da16",
4
4
  "description": "Svelte 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-dev.10+b28398ab",
25
- "@markuplint/ml-ast": "4.0.0-dev.10+b28398ab",
26
- "@markuplint/parser-utils": "4.0.0-dev.10+b28398ab",
24
+ "@markuplint/html-parser": "4.0.0-dev.20+6b35da16",
25
+ "@markuplint/ml-ast": "4.0.0-dev.20+6b35da16",
26
+ "@markuplint/parser-utils": "4.0.0-dev.20+6b35da16",
27
27
  "svelte": "^4.2.8"
28
28
  },
29
- "gitHead": "b28398ab9c8f0ad790f2915ad5da8f3a80e9b8d6"
29
+ "gitHead": "6b35da161d94f784953d0adecc2d28502052d92a"
30
30
  }