tweak for new marked

This commit is contained in:
Gordon Williams 2022-07-20 15:54:43 +01:00
parent 1f2a3b4521
commit 5ac00d984e

View File

@ -5,26 +5,23 @@
// This build a JSON description file for Tern.js as
// specified here: http://ternjs.net/doc/manual.html#typedef
var marked = v => v;
try {
marked = require('marked');
// Set default options except highlight which has no default
marked.setOptions({
gfm: true, // github markdown
highlight: function (code) {
return require('highlight.js').highlightAuto(code).value;
},
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false,
langPrefix: 'lang-'
});
} catch (e) {
console.error("WARNING: marked is not installed");
}
var marked = require('marked');
// yay - new marked version incompatible with old one...
if (marked.marked) marked=marked.marked;
// Set default options except highlight which has no default
marked.setOptions({
gfm: true, // github markdown
highlight: function (code) {
return require('highlight.js').highlightAuto(code).value;
},
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false,
langPrefix: 'lang-'
});
var hadErrors = false;