rsms / markdown-wasm

Very fast Markdown parser and HTML generator implemented in WebAssembly, based on md4c
https://rsms.me/markdown-wasm/
MIT License
1.53k stars 64 forks source link

Reference images inside reference links #4

Closed drwpow closed 4 years ago

drwpow commented 4 years ago

Given the following markdown (this one found in testing-library/react-testing-library):

[![Build Status][build-badge]][build]

[build-badge]: https://img.shields.io/travis/testing-library/react-testing-library.svg?style=flat-square
[build]: https://travis-ci.org/testing-library/react-testing-library

This is expected:

<a href="https://travis-ci.org/testing-library/react-testing-library"><img src="https://img.shields.io/travis/testing-library/react-testing-library.svg?style=flat-square" alt="Build Status" /></a>

But instead the following markup is generated (link is after <img> tag, and extra square brackets are left):

[<img src="https://img.shields.io/travis/testing-library/react-testing-library.svg?style=flat-square" alt="Build Status">]<a href="https://travis-ci.org/testing-library/react-testing-library">build</a>

While I can’t say I’ve ever used the pattern much, it seems that quite a number of packages on npm use this paradigm.

Would love to help on this issue if desired. Thanks!

mity commented 4 years ago

Fixed in MD4C upstream.

Next time, feel free to open issues there if it can be reproduced with it. :)

rsms commented 4 years ago

Fix patched from upstream (thank you @mity!) & published in v1.1.2