Skip to content

Commit b251b07

Browse files
committed
fix(define-render): ignore comment in style block
1 parent be6bd50 commit b251b07

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

Diff for: playground/src/App.vue

+7
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ const compRef = shallowRef()
3232
</template>
3333
</Comp>
3434
</template>
35+
36+
<style scoped>
37+
/* Test comment */
38+
body {
39+
font-size: 14px;
40+
}
41+
</style>

Diff for: src/rules/setup-sfc.yml

+24-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@ fix: |-
1919
2020
---
2121

22+
id: setup-sfc start ignore comment in style
23+
language: html
24+
rule:
25+
kind: raw_text
26+
pattern: $A
27+
inside:
28+
kind: style_element
29+
transform:
30+
B:
31+
replace:
32+
replace: \*/
33+
by: '*\/'
34+
source: $A
35+
fix: |-
36+
$B
37+
38+
---
39+
2240
id: setup-sfc end comment
2341
language: html
2442
rule:
@@ -44,7 +62,12 @@ transform:
4462
startChar: 2
4563
endChar: -2
4664
source: $A
47-
fix: $B
65+
C:
66+
replace:
67+
replace: \*\\/
68+
by: '*/'
69+
source: $B
70+
fix: $C
4871

4972
---
5073

0 commit comments

Comments
 (0)