Language-tools: 当前面的组件自关闭时,语法高亮显示不正确

创建于 2021-01-18  ·  3评论  ·  资料来源: sveltejs/language-tools

当前面的组件是自关闭时,语法高亮是不正确的。 (见下面的截图。)

您可以将以下代码复制到*.svelte文件中以查看:

<SelfClosingComponent/>
<div>stuff</div> <!-- highlight problem with opening tag -->
<div>stuff</div> <!-- no highlight problem -->

<SelfClosingComponent/>
<meta/> <!-- highlight problem -->

<SelfClosingComponent/>
<div/> <!-- highlight problem, but also not valid html, so...??? -->

<SelfClosingComponent/>
<!-- <Intro/> --> <!-- highlight problem -->
<!-- <Intro/> --> <!-- returns to normal after problem -->

<SelfClosingComponent></SelfClosingComponent>
<div>stuff</div> <!-- no highlight problem when component has ending tag -->

预期行为
在自关闭组件(例如<SelfClosingComponent/> Highlight 应恢复正常行为。

截屏
image

系统(请填写以下信息):

  • 操作系统:MacOS Catalina v10.15.3
  • IDE: VSCode v1.52.1 提交 ea3859d4ba2f3e577a159bc91e3074c5d85c0523
  • 插件/包:适用于 VSCode 的 Svelte
Fixed bug

所有3条评论

可能相关: https :

一个更简单的例子

<div/>
<div></div>

Code_2021-01-22_18-04-16

只有在关闭部分之前没有空格时才会发生
Code_2021-01-22_18-05-01

呜呼! 谢谢@dummdidumm!

此页面是否有帮助?
0 / 5 - 0 等级