IonicaBizau/medium-editor-markdown

v 3.0 doesn't allow Rule Extending (formally converters)

Closed this issue · 2 comments

New spec : https://github.com/domchristie/turndown/wiki/Migrating-from-to-markdown-to-Turndown#extending-with-rules

e.g.

var turndownService = new TurndownService()
turndownService.addRule('strikethrough', {
  filter: ['del', 's', 'strike'],
  replacement: function (content) {
    return '~' + content + '~'
  }
})
turndownService.turndown(stringOfHTML)

This means that the { converters } option probably needs to be a rules opttion, which where each rule is manually added with addRule at init ?

Good point! 👍 Indeed!

Contributions are welcome in this direction!

I came across a similar need to use a custom converter using the new "rules" approach.

So I've created a PR here: #59