https://github.com/showdownjs/twitter-extension
Twitter extension for Showdown
https://github.com/showdownjs/twitter-extension
Last synced: about 1 year ago
JSON representation
Twitter extension for Showdown
- Host: GitHub
- URL: https://github.com/showdownjs/twitter-extension
- Owner: showdownjs
- License: bsd-2-clause
- Created: 2015-01-05T01:14:25.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-01-27T20:55:19.000Z (over 9 years ago)
- Last Synced: 2025-05-11T18:01:40.493Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 5
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Showdown's Twitter Extension
==========================
[](https://travis-ci.org/showdownjs/twitter-extension) [](http://badge.fury.io/js/showdown-twitter) [](http://badge.fury.io/bo/showdown-twitter)
------
**Twitter extension for [showdown](https://github.com/showdownjs/showdown)**
Adds support for:
@username -> @username
#hashtag -> #hashtag
## Installation
### With [npm](http://npmjs.org)
npm install showdown-twitter
### With [bower](http://bower.io/)
bower install showdown-twitter
### Manual
You can also [download the latest release zip or tarball](https://github.com/showdownjs/twitter-extension/releases) and include it in your webpage, after showdown:
<script src="showdown-twitter.min.js">
### Enabling the extension
After including the extension in your application, you just need to enable it in showdown.
var converter = new showdown.Converter({extensions: ['twitter']});
## Example
```javascript
var converter = new showdown.Converter({extensions: ['twitter']}),
input = 'This is a tweet from @showdownjs with the hashtag #showdownRules',
html = converter.makeHtml(input);
console.log(html);
```
This should output:
```html
<p>This is a tweet from <a href="http://twitter.com/showdownjs">@showdownjs</a> with the hashtag <a href="http://twitter.com/search/%23showdownRules">#showdownRules</a></p>
```
## License
These files are distributed under BSD license. For more information, please check the [LICENSE file](https://github.com/showdownjs/twitter-extension/blob/master/LICENSE) in the source code.