Skip to content

Commit

Permalink
Add --no-links option (Mermade#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardenize authored and MikeRalphson committed Aug 17, 2018
1 parent f1f8fec commit 270dc8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Version numbers of Shins aim to track the version of Slate they are compatible w
* `node shins.js --minify` or
* `node shins.js --customcss` or
* `node shins.js --inline` or
* `node shins.js --unsafe`
* `node shins.js --unsafe` or
* `node shins.js --no-links`
* To add custom logo add `--logo` option with path to your logo image.
* To specify a different output filename from the default `./index.html`, use the `--output` or `-o` option.
* To allow css-style attributes in markdown, specify the `--attr` option.
Expand Down Expand Up @@ -60,6 +61,7 @@ options.minify = false;
options.customCss = false;
options.inline = false;
options.unsafe = false; // setting to true turns off markdown sanitisation
options['no-links'] = false; // if true, do not automatically convert links in text to anchor tags
//options.source = filename; // used to resolve relative paths for included files
shins.render(markdownString, options, function(err, html) {
// ...
Expand All @@ -76,6 +78,7 @@ options.minify = false;
options.customCss = false;
options.inline = false;
options.unsafe = false; // setting to true turns off markdown sanitisation
options['no-links'] = false; // if true, do not automatically convert links in text to anchor tags
//options.source = filename; // used to resolve relative paths for included files
options.logo = './my-custom-logo.png'
shins.render(markdownString, options)
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ function clean(s) {
function render(inputStr, options, callback) {

if (options.attr) md.use(attrs);
if (options.hasOwnProperty('no-links')) md.disable('linkify')

if (typeof callback === 'undefined') { // for pre-v1.4.0 compatibility
callback = options;
Expand Down
1 change: 1 addition & 0 deletions shins.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if (options.help) {
console.log('--minify minify output html');
console.log('-o,--output specify output html file');
console.log('--unsafe do not sanitise input markdown');
console.log('--no-links do not automatically convert links in text to anchor tags');
process.exit(0);
}

Expand Down

0 comments on commit 270dc8f

Please sign in to comment.