Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cybercase/showdown-target-blank
Showdown extension that adds target="_blank" as attribute to every link in your rendered markdown text
https://github.com/cybercase/showdown-target-blank
Last synced: 3 months ago
JSON representation
Showdown extension that adds target="_blank" as attribute to every link in your rendered markdown text
- Host: GitHub
- URL: https://github.com/cybercase/showdown-target-blank
- Owner: cybercase
- License: bsd-2-clause
- Created: 2015-04-24T13:31:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-25T14:08:23.000Z (almost 9 years ago)
- Last Synced: 2024-09-27T03:07:29.511Z (3 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Showdown's Target Blank Extension
==========================**Target Blank extension for [showdown](https://github.com/showdownjs/showdown)**
Adds support for:
[somelink](https://some.url.com/some/path) -> somelink
## Installation
### With [npm](http://npmjs.org)
npm install showdown-target-blank
### With [bower](http://bower.io/)
bower install showdown-target-blank
### Manual
You can also [download the latest release zip or tarball](https://github.com/cybercase/showdown-target-blank/releases) and include it in your webpage, after showdown:
<script src="showdown-target-blank.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: ['targetblank']});
## Example
```javascript
var converter = new Showdown.converter({extensions: ['targetblank']}),
input = 'This is a [link](http://www.example.com)',
html = converter.makeHtml(input);
console.log(html);
```This should output:
```html
<p>This is a <a target="_blank" href="http://example.com">link</a></p>
```## License
These files are distributed under BSD license. For more information, please check the [LICENSE file](https://github.com/cybercase/showdown-target-blank/blob/master/LICENSE) in the source code.