mrhanlon / less-than-slash

Atom.io package for closing open tags when `</` is typed, like in Sublime Text 3.
MIT License
23 stars 6 forks source link

Add support for {{#Handlebars helpers}} #14

Closed MarcPorciuncula closed 9 years ago

MarcPorciuncula commented 9 years ago

Adds support for the autocompletion of Handlebars helpers such as {{#if}} upon typing {{/

I've made a second parsing function parseHandlebars with its own regex, the new parse function selects which one to use.

There is a case with weird behaviour, it does however require obvious error on the user's part. Given the text

<div>

Beginning to type the wrong type of closing tag {{/ results in

<div>
{{/div}}

Should less-than-slash just not autocomplete when the user initiates the wrong type of closing tag? Or perhaps it should insert the correct one no matter which closing tag you type.

MarcPorciuncula commented 9 years ago

I've just done a major refactor of less-than-slash that should make additions such as this one much easier and cleaner, I'm about to open the pull request.