-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference-style links inside tables are broken since version 3 #2217
Comments
I ran into this very issue and did a bit of troubleshooting (I'm using a custom renderer). What I found was that the tablecell render function receives a rendered link as the content in the following cases which is the expected behavior:
The bug only appears when the link reference is declared below where it is referenced. The simplest workaround would be to move your link reference declarations to the top of the markdown file. |
Interesting... doesn't appear to be needed exactly at the top of the .md file though as you alluded to... just above the references. This is what has been stopping us from migrating to a newer marked. Not sure I want to ask all of our users to do this though... not to mention any comments to be fixed. OY. Thanks for the workaround mention. |
also seeing this. wrote an ugly little failing test case: it('should correctly parse reference links in tables', () => {
const md = `
| Column 1 | Column 2 |
|----------|--------------------- |
| Foo | [Bar][referenceLink] |
[referenceLink]: https://www.google.com
`;
const html = marked(md);
expect(html).toBe(`<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody><tr>
<td>Foo</td>
<td><a href="https://www.google.com">Bar</a></td>
</tr>
</tbody></table>
`);
}); and a quick |
The PlayCanvas Developer Site was just affected by this too. We recently upgraded marked and all reference style links in markdown tables stopped working (without us noticing at first). I have now switched them all to inline links. So while we're OK after this fixing up, it'd be great to get reference style links in tables working again. |
🎉 This issue has been resolved in version 4.0.16 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* *marked* seems to have finally fixed tables... seems 1 to 1... still has issues with html tags per OpenUserJS#1775 via markedjs/marked#2217 and markedjs/marked#2471
Marked version: 3+
Describe the bug
Reference-style links inside tables are broken since version 3. Version 2.1.3 works fine.
[I'm a reference-style link][Arbitrary case-insensitive reference text]
To Reproduce
npm install --save marked@3.0.4
Expected behavior
The text was updated successfully, but these errors were encountered: