Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.07 KB

File metadata and controls

43 lines (31 loc) · 1.07 KB

Showdown internal link extension

Showdown extension to allow shorthanded internal links, using Wiki style [[link]] or [[link address|link name]].

Escapes HTML characters and provides the ability to configure how internal links will be prefixed and suffixed.

Client-side

<script src="/path/to/showdown/src/showdown.js"></script>
<script src="/path/to/showdown-intlink-filter.js"></script>
var converter = new showdown.Converter({extensions: ['intlink']});

Configuration: (note that this will probably change in the near future)

window.Showdown.extensions.intlinkConfig({
  pathPrefix : '/images/',
  pathSuffix : '.jpg'
};

Server-side (node)

var showdown = require('showdown');
var linkFilter = require('../showdown-intlink-filter').intlink;
var converter = new showdown.Converter({extensions: [linkFilter]});

Configuration:

require('../showdown-intlink-filter').intlinkConfig({
  pathPrefix : '/images/',
  pathSuffix : '.jpg'
};