Skip to content

Commit e112720

Browse files
fix: ignore uppercase chars in data-v-* attributes (#338)
1 parent 0c6f3f0 commit e112720

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/runtime/validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const useChecker = (
2626
}
2727

2828
// Clean up Vue scoped style attributes
29-
html = typeof html === 'string' ? html.replace(/ ?data-v-[-a-z0-9]+(=["']([-a-z0-9]|\/|:|\.)*["'])?/g, '') : html
29+
html = typeof html === 'string' ? html.replace(/ ?data-v-[-A-Za-z0-9]+(=["']([-A-Za-z0-9]|\/|:|\.)*["'])?/g, '') : html
3030
const { valid, results } = validator.validateString(html)
3131

3232
if (valid && !results.length) {

test/checker.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('useChecker', () => {
128128

129129
await checker(
130130
'https://test.com/',
131-
'<a style="color:red" class="xxx" data-v-inspector="xxxx/xxx.vue:2:3">Link</a>'
131+
'<a style="color:red" class="xxx" data-v-inspector="Xxxx/Xxx.vue:2:3">Link</a>'
132132
)
133133
expect(mockValidator).toHaveBeenCalledWith(
134134
'<a style="color:red" class="xxx">Link</a>'

0 commit comments

Comments
 (0)