Skip to content

Commit d7916a5

Browse files
authored
fix(vue-i18n): Allow additional attributes on i18n component (#865)
* fix(vue-i18n): Allow additional attributes on i18n component * dont allow whitespace before/after "=", allow lf after attr
1 parent b3749c8 commit d7916a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/frameworks/vue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class VueFramework extends Framework {
3030

3131
// for visualize the regex, you can use https://regexper.com/
3232
usageMatchRegex = [
33-
'(?:i18n(?:-\\w+)?[ (\n]\\s*(?:key)?path=|v-t=[\'"`{]|(?:this\\.|\\$|i18n\\.|[^\\w\\d])(?:t|tc|te)\\()\\s*[\'"`]({key})[\'"`]',
33+
'(?:i18n(?:-\\w+)?[ \\n]\\s*(?:\\w+=[\'"][^\'"]*[\'"][ \\n]\\s*)?(?:key)?path=|v-t=[\'"`{]|(?:this\\.|\\$|i18n\\.|[^\\w\\d])(?:t|tc|te)\\()\\s*[\'"`]({key})[\'"`]'
3434
]
3535

3636
refactorTemplates(keypath: string, args: string[] = [], doc?: TextDocument, detection?: DetectionResult) {

0 commit comments

Comments
 (0)