metalsmith / metalsmith/markdown
marked v13's token renderer
- Dominant language
- JavaScript
- Stars
- 62
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
Unfortunately `marked` changed the function signatures on the renderer object.
I have [some code to alter renderer behavior](https://github.com/emmercm/www/blob/c86bfb573170ede98cbc3e4c980b52e28475ae5a/index.js#L146-L213):
```javascript
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:
```javascript
import markdown from '@metalsmith/markdown';
Metalsmith(path.resolve())
// ...
.use(markdown({
renderer: markdownRenderer
}))
// ...
```
https://github.com/markedjs/marked/pull/3291 made it so renderers created with `marked` v13+ code are incompatible with
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by inspecting the plugin's marked dependency and renderer integration, then compare them with the renderer signatures described in the issue and the linked marked pull request. Decide whether the intended outcome is a compatibility warning or a major dependency upgrade; done means the chosen compatibility behavior is documented and verified against the renderer example in index.js.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- content
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100