metalsmith / markdown

A metalsmith plugin to render markdown files to HTML.
MIT License
63 stars 65 forks source link

Cannot read property 'slug' of undefined #37

Closed oupala closed 5 years ago

oupala commented 5 years ago

After upgrading plugin metalsmith-markdown from version 0.2.1 to 1.0.0, I now get the following error:

TypeError: Cannot read property 'slug' of undefined Please report this to https://github.com/markedjs/marked. at Renderer.heading (/home/romain/Documents/dev/recommendations/metalsmith/node_modules/marked/lib/marked.js:962:17)

Do you have any idea where it could come from?

oupala commented 5 years ago

It seems that using a custom marked markdown renderer is the cause of the problem (commenting it resolve the error).

But I want to use a custom renderer for styling tables. How can I do that?

oupala commented 5 years ago

36 seems to have successfully used a custom renderer.

oupala commented 5 years ago

It seems that the marked custom renderer should use the same marked version as the dependency specified in metalsmith-markdown.

I had updated the custom marked custom renderer to version 0.6.0 while metalsmith-markdown is using version 0.4.0 as its dependency.

woodyrew commented 5 years ago

I'll mark this as resolved because you've resolved the issue.