Skip to content

RC3: how to upgrade existing markdown renderer overrides v4->v5? #2680

@thediveo

Description

@thediveo

Description

With v4 I'm using the following to implement footnote handling in docsify:

window.$docsify = {
  // ...
  markdown: function (marked, renderer) {
        marked.setOptions({
          smartypants: true,
          renderer: Object.assign(renderer, {
            paragraph(text) {
              return marked.Renderer.prototype.paragraph.apply(null, [
                interpolateReferences(interpolateFootnotes(text))
            ])},
            text(text) {
              return marked.Renderer.prototype.text.apply(null, [
                interpolateReferences(interpolateFootnotes(text))
            ])},
          }),
        })
        return marked
      },
  // ...
}

Expected behavior

Modified markdown rendering functionality to handle footnotes.

Actual behavior

v4 markdown handling configuration gets ignored in v5; the renderer methods get ignored.

Steps to reproduce

.

Environment

How to migrate this from v4->v5?

Additional Information

  • Bug still occurs when all/other plugins are disabled?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triagebugconfirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions