mizzao/meteor-autocomplete — pull request #50 by zencephalon (2014-06-24 14:05:26+00:00)
Title: Added flexibility for autocomplete rules

Hey mizzao,

Thank you so much for this library, I have used it incessantly in all of my Meteor projects since finding out about it. I have used a forked version for a while though, because I needed some added flexibility for features like Markdown link autocompletion.

I wanted to send over this pull request so that people can get even more use out of this library.

For example, I use the following configuration in order to trigger autocomplete on `](` and then automatically close the link with `)` upon a successful completion.

```
Template.prose_edit.settings = function() {
return {
position: "bottom",
limit: 5,
rules: [{
token: '\\]\\(',
replacement: '](',
end_token: ')',
collection: Proses,
field: "url",
template: Template.prose_url_title
}]
}
}
```