ember-twitter-entities 5.3.1
Install from the command line:
Learn more about npm packages
$ npm install @zestia/ember-twitter-entities@5.3.1
Install via package.json:
"@zestia/ember-twitter-entities": "5.3.1"
About this version
This Ember CLI addon parses Twitter Entities from the Twitter API and renders a them as Ember Components.
ember install @zestia/ember-twitter-entities
https://zestia.github.io/ember-twitter-entities
- Supported entity types are:
hashtags
,media
,urls
,user_mentions
,symbols
. Basically any entity which has anindices
property and occurs in the tweet text. So this excludespolls
.
Given the following:
entities: {
urls: [{
url: 'https://t.co/emberjs',
display_url: 'emberjs.com',
indices: [6, 17]
}],
hashtags: [],
user_mentions: [],
media: [],
symbols: []
}
The addon will render:
visit <a href="http://t.co/emberjs">emberjs.com</a>
...using the built in components for each entity type.
Required. The text to parse to find entities within.
Required. An object of entities that includes information about where each entity appears within the @text
.
Optional. The component that will be used to display a URL entity.
Optional. The component that will be used to display a hashtag entity.
Optional. The component that will be used to display a user mention entity.
Optional. The component that will be used to display a media entity.
Optional. The component that will be used to display a symbol entity.
Each component receives the entity so it can be displayed however you wish.
If the tweet you are rendering is already encoded, flag it as html-safe to prevent double encoding.
Example
const tweet = 'This tweet contains <br> HTML';
this.text = htmlSafe(tweet);
Outputs: This tweet contains <br> HTML
Instead of: This tweet contains <br> HTML
Details
- ember-twitter-entities
- zestia
- over 1 year ago
- MIT
- 41 dependencies
Assets
- ember-twitter-entities-5.3.1.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0