@markuplint/svelte-parser 4.0.0-alpha.5 → 4.0.0-alpha.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2023 Yusuke Hirao
3
+ Copyright (c) 2017-2024 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="svelte" />
1
2
  import type { Directive, TemplateNode, Attribute, SpreadAttribute } from 'svelte/types/compiler/interfaces';
2
3
  export type SvelteNode = TemplateNode;
3
4
  export declare function svelteParse(template: string): SvelteNode[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/svelte-parser",
3
- "version": "4.0.0-alpha.5",
3
+ "version": "4.0.0-alpha.7",
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-alpha.5",
25
- "@markuplint/ml-ast": "4.0.0-alpha.5",
26
- "@markuplint/parser-utils": "4.0.0-alpha.5",
27
- "svelte": "^4.2.2"
24
+ "@markuplint/html-parser": "4.0.0-alpha.7",
25
+ "@markuplint/ml-ast": "4.0.0-alpha.7",
26
+ "@markuplint/parser-utils": "4.0.0-alpha.7",
27
+ "svelte": "^4.2.8"
28
28
  },
29
- "gitHead": "0c3e4690662edf1765bcc4b6411ec5507c1e2ea3"
29
+ "gitHead": "571129bf6498541125e1e7c3907d5ed9af53459a"
30
30
  }