如何为 JSON 中的 HTML 标签获取语法高亮?

问题描述 投票:0回答:1

我有 i18next JSON 文件,其中包含 HTML 标签,如下所示:

{
"h2": "How to<br /><span className='text-orange-500'>sign</span> up"
}

我想对 HTML 标签进行适当的语法高亮显示,但我一直找不到解决方案。

有什么办法可以在 VS Code 中实现这一点吗?

json visual-studio-code syntax-highlighting i18next
1个回答
0
投票

You can get html syntax coloring in a

json
file with this setting:

"files.associations": {
  "*.json": "html"
},

你可以像这样更具体:

"files.associations": {
  "myComponent.json": "html"
},
© www.soinside.com 2019 - 2024. All rights reserved.