markdown-it-bracketed-spans icon indicating copy to clipboard operation
markdown-it-bracketed-spans copied to clipboard

Content including links parsed incorrectly

Open lahdekorpi opened this issue 5 years ago • 2 comments

Example MD:

[This is an example of [Google](www.google.com)]{.class}

Expected output:

<p class="class">This is an example of <a href="www.google.com">Google</a></p>

Current output:

<p class="class">[This is an example of <a href="www.google.com">Google</a>]</p>

Test code (ts):

import MarkdownIt from "markdown-it";

const md = new MarkdownIt({
        linkify: true,
        breaks: true
})
        .use(require("markdown-it-bracketed-spans"))
        .use(require("markdown-it-attrs"), {
                allowedAttributes: ["class"]
        });

console.log(md.render(`
[This is an example of [Google](www.google.com)]{.class}
`));

lahdekorpi avatar Aug 04 '20 08:08 lahdekorpi

indeed... that would be nice to fix. unfortunately, it's been quite some time since I wrote that code, so pulls welcome :-)

mb21 avatar Aug 04 '20 08:08 mb21

I currently have the same problem

cuonghuunguyen avatar Apr 06 '22 04:04 cuonghuunguyen