hexojs / hexo-renderer-markdown-it

Markdown-it is a Markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.
MIT License
343 stars 60 forks source link

fix: handle defaults correctly #92

Closed curbengh closed 4 years ago

curbengh commented 4 years ago

noticed Object.assign() doesn't do deep cloning,

In the following config, the defaults level and collisionSuffix are not parsed to the plugin in current behavior.

markdown:
  anchors:
    permalink: true

This PR ensure defaults are handled correctly, so that level and collisionSuffix are retained.


also fixed an issue where duplicate titles are not handled correctly, should be Object.prototype.hasOwnProperty(), not Object.prototype.isPrototypeOf()