html - 语法突出显示不适用于 Visual Studio 2015 Update 3 中的 Node.js Vash View 文件

标签 html node.js visual-studio-2015 vash

在 Visual Studio 2015 Update 3 中,我正在构建一个 Node.js 应用程序并使用 Vash 作为 View 引擎。但是,当我在 vash 文件中编写 HTML 时,语法突出显示不起作用。它只是显示为纯文本。例如,这个:

<!DOCTYPE html>
<html>
<head>
    <title>@model.title</title>
</head>
<body>
    <div>@model.block("body")</div>
</body>
</html>

会完全没有任何突出显示。

最佳答案

感谢 UPNXT 的 Clint Helfers(参见 here),我能够使突出显示工作正常:

在 Visual Studio 2015 中,转到“工具”>“选项”>“文本编辑器”>“文件扩展名”,然后使用编辑器 HTML (Web Forms) Editor 添加 vash 作为扩展名。见下文:

enter image description here

一旦我这样做了,我必须关闭打开的 .vash 文件,然后,当我重新打开它们时,所有 HTML 突出显示都起作用了。

关于html - 语法突出显示不适用于 Visual Studio 2015 Update 3 中的 Node.js Vash View 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41882115/

相关文章:

visual-studio-2015 - 如何在 Visual Studio 2015 中创建 localdb?

.net - 什么是 csproj 文件中的 <MvcProjectUpgradeChecked> 元素

python - 未绑定(bind)本地错误: local variable 'html' referenced before assignment

html - 将 OTF 字体添加到网页

message-queue - 使用 AMQP 和 Node.JS 进行实时数据同步

node.js - Node JS EJS 获取 URL 参数

visual-studio-2013 - VS2013或VS2015显示 "unspecified error"

html - 导航栏没有获取页面的所有宽度

javascript - 单击任何 <li> 元素时显示

node.js - 检索存储在 AWS EB 环境变量中的 JSON 时不带引号