Linkify URLs in an Ember app with a helper that uses a tested
url-regex and Handlebars Utils.escapeExpression
to ensure links are safe.
ember install ember-linkify
You can specify options to the helper such as 'urlLength' which shortens the URL by 'urlLength' and add 3 dots to the end
For instance, the following will ensure that the https
scheme is used for the created link:
Also use options to specify attributes you want to add to the generated anchor tags. Currently, "rel" and "class" are the only recognized attributes.
You can also set the target attribute for the generated anchor tag by passing in a second parameter.
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
ember test
ember test --server
ember build
For more information on using ember-cli
, visit http://www.ember-cli.com/.
MIT
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted with <3 by John Otander(@4lpine).