This Ember addon takes some text, which may or may not contain URLs and renders the text and each URL as an Ember component.
ember install @zestia/ember-wrap-urls
https://zestia.github.io/ember-wrap-urls/
Given the following:
Will render:
Check out my link <span class="wrapped-url">http://example.com</span>
This addon comes with two extra components:
wrap-urls/url
wrap-urls/link
By default, URLs will be rendered using wrap-urls/url
You can set @component
to change which component is used to render each URL:
Will result in:
Visit <a class="wrapped-url-link" href="http://example.com">http://example.com</a>
Specify your own @pattern
to use for finding hyperlinks, and your own @component
to customise how they are rendered.
In your component's template you will have access to: