Merge pull request #47 from leafOfTree/lang-attr
test / vim stable (push) Canceled after 0s
test / vim v8.2.0000 (push) Canceled after 0s
test / nvim stable (push) Canceled after 0s
test / nvim v0.9.5 (push) Canceled after 0s

Allow lang without quotes and lang="typescript"
This commit is contained in:
leaf authored and GitHub committed 2026-10-21 21:15:00 +08:00
commit 824aff651d
4 files changed
+42 -3

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
" lang in double or single quotes or without quotes, and
" lang="typescript"
let g:vim_vue_plugin_config = {
\'syntax': {
\ 'template': ['html'],
\ 'script': ['javascript', 'typescript'],
\ 'style': ['css', 'scss', 'sass'],
\},
\}
function! Check()
call ExpectEqual(GetVueSyntax(), 'html', 'syntax at line 1')
call ExpectBlock('let a', 'script', 'typescript', 'typescriptScriptBlock')
call ExpectBlock('let b', 'script', 'typescript', 'typescriptScriptBlock')
call ExpectBlock('$c', 'style', 'scss', 'cssScssStyleBlock')
call ExpectBlock('color: red', 'style', 'sass', 'sassStyleBlock')
endfunction
+20
View File
@@ -0,0 +1,20 @@
<template lang=html>
<div>x</div>
</template>
<script lang=ts>
let a: number = 1
</script>
<script lang="typescript">
let b: number = 2
</script>
<style lang='scss'>
$c: 1px;
</style>
<style lang=sass>
p
color: red
</style>