2

Similar to this question, I would like to know how to escape the "<" and ">" characters in a Visual Studio snippet literal element. I'm trying to make a Django url snippet, and the Django parameter names are enclosed in "<" and ">". Adding these characters gives an invalid syntax error in the xml file. Is there a way to escape these characters? Thanks!

pwilcox
  • 5,542
  • 1
  • 19
  • 31
Shawn
  • 717
  • 11
  • 31
  • Did you find an answer? I'm trying to invoke a generic method in C# with a snippet, but can't because of the `<` and `>`. – DJH Apr 28 '16 at 15:15
  • 1
    I did not. I went with a general parameter for the regex portion of the url, and am typing the < and > characters manually. – Shawn Apr 28 '16 at 21:34
  • @DarrenHale, it's very late and so likely not an issue for you anymore, but I'm wondering if you ever found your answer, or if it's still relevant, if use of `<` was/is the solution. – pwilcox Aug 17 '21 at 18:38

1 Answers1

0

My use case isn't python or django (it's SQL), and I'm not changing a 'literal' element (it's a 'code' element), but I don't think it matters. The snippets are XML files. So use &lt;.

pwilcox
  • 5,542
  • 1
  • 19
  • 31