@sola-air-ui/compiler 1.4.0 → 1.4.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/check.js +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sola-air-ui/compiler",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Compiler for Sola single-file components (.sola) \u2014 transforms template + script + style to ES modules",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/check.js CHANGED
@@ -14,9 +14,12 @@ export const RULES = {
14
14
  SOLA001: 'unbalanced block'
15
15
  };
16
16
 
17
- // Blank out <script> and <style> bodies, keeping newlines so line numbers hold.
17
+ // Blank out <script> and <style> bodies and HTML comments, keeping newlines so
18
+ // line numbers hold. A commented-out block is not a block.
18
19
  function maskNonTemplate(source) {
19
- return source.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, (m) => m.replace(/[^\n]/g, ' '));
20
+ return source
21
+ .replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, (m) => m.replace(/[^\n]/g, ' '))
22
+ .replace(/<!--[\s\S]*?-->/g, (m) => m.replace(/[^\n]/g, ' '));
20
23
  }
21
24
 
22
25
  function position(source, index) {