【发布时间】:2018-11-20 14:21:52
【问题描述】:
我正在从 Dreamweaver (我知道它很糟糕,但它有它的用途) 从电子邮件开发迁移到 VS Code。 Dreamweaver 提供的一个方便的功能是使用自定义 sn-ps。 VS Code 也提供了custom snippets,但它与Dreamweaver snippets 的工作方式不同,而且我所看到的需要更多的努力。下面是 VS Code 中发生的事情。
VS Code 自定义 sn-p
{
"Preheader": {
"prefix": "preheader",
"body": [
"<span style="display:none !important; mso-hide: all; color:#FEE4DC; max-height: 0px; overflow: hidden;">text goes here</span>"
],
"description": "preheader for email"
}
}
结果
<span style=
预期结果
<span style="display:none !important; mso-hide: all; color:#FEE4DC; max-height: 0px; overflow: hidden;">text goes here</span>
看来我必须进行一些转义才能获得预期的结果?这有点普通,因为我的电子邮件开发过程中可能有大量代码:(
我是否使用 VS Code 中的正确功能来创建客户 sn-ps?或者我使用的功能不正确。
【问题讨论】:
-
无非是报价问题。将 style 属性中的双引号改为单引号。瞧!问题解决了。
-
嗯,前面的答案就是这么说的......
标签: html visual-studio-code dreamweaver code-snippets