@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.
- package/package.json +1 -1
- package/src/check.js +5 -2
package/package.json
CHANGED
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
|
|
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
|
|
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) {
|