【发布时间】:2011-12-25 10:05:56
【问题描述】:
我想创建一个环绕的 sn-p,它两次使用 $selected$ 文本 - 作为 HTML 链接的文本和标题。这是我写的:
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>My Link</Title>
<Author>Me</Author>
<Description>Makes a special link.</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>myLink</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>Link</ID>
<ToolTip></ToolTip>
<Default>http://www.aggienetwork.com</Default>
<Function></Function>
</Literal>
</Declarations>
<Code Language="html"><![CDATA[<a style="color: #1a4e9d; text-decoration: none;"
href="$Link$" title="$selected$" target="_blank">$selected$</a>$end$]]></Code>
</Snippet>
</CodeSnippet>
如果我使用它,$selected$ 文本只会作为文本出现一次,并且 title 属性为空白。有谁知道如何进行这项工作?
【问题讨论】:
标签: visual-studio-2010 code-snippets