emmetio / emmet-atom

Emmet support for Atom
MIT License
764 stars 181 forks source link

Abbreviations not working completely #520

Open jordan-webdev opened 7 years ago

jordan-webdev commented 7 years ago

Why is it when I try to expand a simple "a", it just gives me "<a></a>"? Isn't it supposed to put an href in there? I tried linking to my own custom extensions folder. I copied all of snippets.json into there. I also tried creating my own abbeviation "testing", but I just get another html tag called <testing>

sergeche commented 7 years ago

Did you set document syntax to HTML?

jordan-webdev commented 7 years ago

It's a php file with html in it. I'm developing a WordPress site.

sergeche commented 7 years ago

https://github.com/emmetio/emmet-atom#tab-key

jordan-webdev commented 7 years ago

Okay cool, that helped with the default snippets, thank you. However, now when I add "testing": "<div class='test'></div>", as an html abbreviation in .atom\packages\emmet\node_modules\emmet\lib\snippets.json, it just expands into <testing></testing>. I also copied the entire snippets.json file into my custom extensions folder, but no luck.

jordan-webdev commented 7 years ago

I am currently using the normal atom snippets as a workaround. To anyone else viewing this, open the attom command palette (ctrl + shift + p on windows). Search for Application: Open Your Snippets, which will open a file you can add a snippets.cson file you can add snippets to. For writing HTML abbreviations in a php file I used the following format, which is working. `'.text.php': 'logo': 'prefix': 'logo' 'body': '

<?php bloginfo( ">
        <span class="screen-reader-text"><?php bloginfo( "name" ); ?></span>
    </a>'`

Now when I enter logo and hit the tab key, it fills out all that HTML + PHP. BTW the code above probably has to be properly formatted, but I can't enter tabs in the code inserter.