Packages

marked

18.2.1 · 16 Nov 2026MIT138.2M / weekRepositoryHomepagenpmAtom feed

Your version

13.0.0

major12 Jun 2024Where it was published

13.0.3 is the newest release of 13.x.

In short

2 breaking6 new2 fixed

  • Breaking

    Add space token after blockquote and hr if there are multiple newlines

  • Breaking

    Send token objects to renderers and move logic to parse tokens from the parser to the renderers.

Release note

Bug Fixes

  • Fix blockquote code continuation

  • Add parser as a property on the Renderer object

  • Send block text tokens to the text renderer

Features

  • Send token objects to renderers

  • Add space renderer that returns empty string by default

  • Add header and align properties to TableCell token

  • Add TableRow token

  • Add Checkbox token

Breaking changes

  • Breaking

    Add space token after blockquote and hr if there are multiple newlines

  • Breaking

    Send token objects to renderers and move logic to parse tokens from the parser to the renderers.

    • Most extensions that update marked renderers should still work with this version but will break in a future major version.

    • Extensions that change marked renderers will need to be updated and use new option useNewRenderer and accept a token object instead of multiple parameters. See updated Renderer docs

      // v12 renderer extension
      
      const extension = {
        renderer: {
          heading(text, level) {
            // increase level by 1
            return `<h${level + 1}>${text}</h${level + 1}>`;
          }
        }
      };
      
      marked.use(extension);
      // v13 renderer extension
      
      const extension = {
        useNewRenderer: true,
        renderer: {
          heading(token) {
            // increase depth by 1
            const text = this.parser.parseInline(token.tokens);
            const level = token.depth;
            return `<h${level + 1}>${text}</h${level + 1}>`;
          }
        }
      };
      
      marked.use(extension);

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.