sta

showdown-transform-anchor-href

Transform href attribute of archor tags by given function

Showing:

Popularity

Downloads/wk

2

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Showdown's transform anchor href extension

Showdown's transform anchor href extension adds support for modifying user provided href.

Working on:

currently only working on node.js

Installation

With npm

npm install showdown-transform-anchor-href

Usage

const Showdown = require('showdown');
const ShowdownTransformAnchorHref = require('showdown-transform-anchor-href');

// setup a transformation function to do whatever you need with the href attr
ShowdownTransformAnchorHref.addTransformation(function(href) {

    return ('http://www.myrwebsite.com/redirect?url='+ new Buffer(href).toString('base64'));
})

showdown.extension('ShowdownTransformAnchorHref', ShowdownTransformAnchorHref);
const converter = new Showdown.Converter({ extensions: ['ShowdownTransformAnchorHref'] });
const input = '[link](example.com)';
const html = converter.makeHtml(input);
console.log(html);

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100