Enabling option ghCodeBlocks
Enabling option encodeEmails
Loading extensions
Could not load extension /path/to/ext.js. Reason:
ERROR: Error in /path/to/ext.js extension-> sub-extension 0: property "type" must be a string, but undefined given
Run 'showdown <command> -h' for help
Code:
showdown = require('showdown');
showdown.extension('ext', function () {
var matches = [];
return [{
type: "lang",
regex: /!>([^]+?)<!/gi,
replace: function (s, match) {
matches.push(match);
var n = matches.length - 1;
return '%PLACEHOLDER' + n + '%';
}
},
{
type: 'output',
filter: function (text) {
for (var i = 0; i < matches.length; ++i) {
var pat = '<p>%PLACEHOLDER' + i + '% *<\/p>';
text = text.replace(new RegExp(pat, 'gi'), '<p class="ds">' + matches[i] + '</p>');
}
//reset array
matches = [];
return text;
}
}
]
});
Trying to run from command line:
Getting error:
Code: