Sublime Forum

Snippet does not work

#1

Hi
I add into snippet new row of code and now it does not work
What error in such snippet?
If i delete this row everything is working.

<snippet>
    <content><![CDATA[
        <script>$(document).ready(function() { $('body').bootstrapMaterialDesign(); });</script>
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>ht</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope></scope>
</snippet>
0 Likes

#2

This is really an unhelpful way of asking for support. The title says Snippet does no work, fine, a snippet is not working for you for some reason, understood. The main message says

So, what is the community supposed to interpret this as ? Can you share the snippet for debugging purposes. Have you set the scope properly ? Are you triggering it in the said scope ? Is the tabTrigger proper ? Are you trying to have a snippet that inserts a boilerplate snippet (there are issues with this). There can be n reasons why it might not be working for you but given proper information we can make that n to just 1. So please have pity on us & give proper information next time.

1 Like

#3

When i go to edit post - there was snippet
I dont know why its not printer
I add quotes and now its printing in topic

0 Likes

#4

Apologies for the previous outburst. :sweat:

In case of snippets, if you want a literal $, then you need to escape it. Try this :-

<snippet>
    <content><![CDATA[
        <script>\$(document).ready(function() { \$('body').bootstrapMaterialDesign(); });</script>
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>ht</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope></scope>
</snippet>
1 Like

#5

Sorry my mistake again! i remember, i promise! Thanks a lot!

0 Likes