HTML and PHP Snippets in href quotes do not work



I’ve made some HTML and PHP Snippets with the scope ‘.text.html.php’ and they work almost everywhere in my .php files, except inside the quotes of a href ( … same problem with classes and basically everywhere inside of quotes).

It’s annoying, for example I cant use PHP Snippets there.

By the way, I’m using Atom 1.8.0, the latest Version. If you need more Infos to help me, feel free to ask.

Thank you!


For snippets you want in quotes, try adding them with .string.html.


Thanks for the fast answer.
Unfortunately, its still not working. My Snippet looks like this:

        'prefix': 'E'
        'body': """<?=$1?>"""

I’ve experimented with the scope (’.string.html’, ‘.string.php’, etc.) but that didnt work either.


Can you share some example code where the snippet doesn’t work? Everything is better with repro steps :grinning:


.string.html works for me. There is no php class in matched quotes, so that won’t work.


For example, just some lines from one of my .php files:

<div class="elements">
    if ($lCatalogID != "") {
    <a href=""><?=$oDic->GetDicItem('newelement')?></a>

When I try to insert my snippet

        'prefix': 'E'
        'body': """<?=$1?>"""

into the quotes of the href, I get no autocompletion and the snippet is not working.


I’m not sure why. It works for me. The snippet and code are exactly the same, and the buffer I’m testing it in is set on the PHP grammar.


I see the same results as @DamnedScholar. The snippet expands on Tab. You are correct that the autocomplete for it doesn’t show up though.