Unfortunately marked changed the function signatures on the renderer object.
I have some code to alter renderer behavior:
import {marked} from 'marked';
const markdownRenderer = new marked.Renderer();
markdownRenderer.heading = (text, level, raw) => {
// ...
};
markdownRenderer.table = (header, body) => {
// ...
};
markdownRenderer.code = (_code, infostring, escaped) => {
// ...
};
and then I provide that renderer like this:
import markdown from '@metalsmith/markdown';
Metalsmith(path.resolve())
// ...
.use(markdown({
renderer: markdownRenderer
}))
// ...
markedjs/marked#3291 made it so renderers created with marked v13+ code are incompatible with <v13 versions of marked, and this plugin's version is quite old.
Maybe a warning about compatible versions of marked would suffice? I suspect this plugin's version of marked is being held back intentionally based on #70.
An eventual major upgrade of this plugin might be nice, and I'm sure you had other items for its roadmap.
Unfortunately
markedchanged the function signatures on the renderer object.I have some code to alter renderer behavior:
and then I provide that renderer like this:
markedjs/marked#3291 made it so renderers created with
markedv13+ code are incompatible with <v13 versions ofmarked, and this plugin's version is quite old.Maybe a warning about compatible versions of
markedwould suffice? I suspect this plugin's version ofmarkedis being held back intentionally based on #70.An eventual major upgrade of this plugin might be nice, and I'm sure you had other items for its roadmap.