Sublime Forum

How to included a less than sign in a snippet?

#1

I’m trying to create a snippet with the less than signs as shown below. But the snippet fails to compile with an error. I tried escaping the less than signs like <<< but that did not work either. How can I include these less than signs in a snippet?

abtit text.plain -------------------------------------------------------------- <<< --------------------------------------------------------------
0 Likes

#2

In order to better see what you’re trying to do that’s not working, can you please edit your text to add code fences around your pasted snippet?

That is, in the post editor it should look something like:

```
snippet data
```

The extra lines with the back-ticks tells the forum that the text inside is special (currently it’s being treated as HTML, which is mostly invisible).

0 Likes

#3

That was ugly! My apologies, I’ve enclosed the snippet in the fence. I’ve been using this “literary device” as a poor man’s chapter maker for quite a number of years. I have a vim abbreviation that adds the lines and the three less than signs, and then I add the context. Then when a text file is full of these I can filter the file and they behave like bookmarks, e.g.,

IST TRUNK MEMBERS <<<
STATUS, ENABLING, AND OTHER STUFF LD 20 <<<
PRINTING DN & TN INFORMATION - LD 20 <<<
ADDING AREA CODE - LD 90 <<<
ADDING EXCHANGE - LD 90 <<<
NAME CHANGE - LD 95 <<<
ENABLING MESSAGE WAITING INDICATOR OPTION <<<
ADDING AGENT CALLING DISPLAY (ACD) LD 11 <<<
CONFIGURATION LISTING LD 22 <<<

<snippet>
<tabTrigger>ttable</tabTrigger>
<scope>text.html.markdown</scope>
<content>
        --------------------------------------------------
                                                        <<<
        --------------------------------------------------
 </content>
 </snippet>
0 Likes

#4

Wrap the snippet contents in <![CDATA[ and ]]>. See also this wikipedia article.

0 Likes

#5

Thanks, I’ll give it a try!

0 Likes