Reference links aren't resolved
Closed this issue · 6 comments
Hello, thanks for the neat plugin!
If you include reference links in the premonition container [x][y]
, where y
is defined at the end of the document, the markdown-to-html converter does not render the link; i believe this could be because when rendering the content of the blockquote, only the blockquote text is fed to the markdown converter (i.e. without the link definition). (I use kramdown.)
> warning "not linked"
> This should have been a [link][example].
[example]: https://www.example.com/
yields
<div class="premonition warning">
<div class="fa fa-exclamation-circle"></div>
<div class="content">
<p class="header">not linked</p>
<p>This should have been a [link][example].</p>
</div>
</div>
Workaround: don't use reference links in the premonition containers; but this requires our authors to know about this limitation. Perhaps there are ways to make the markdown converter aware of some wider context?
Thanks for reporting this. Haven't actually crossed my mind that this could be a problem. I will look into this and see if I can come up with a fix.
Some of these features (reference links, footnotes, etc) were important to me, so I went ahead and wrote my own plugin for content blocks to solve this problem. It's quite rudimentary right now, and not very configurable for the moment, so be warned!
@lazee, the section called "How does it work?" in the README of my plugin explains the approach, and may be a source of inspiration for a fix. The key idea is that the Markdown content of a block shouldn't be parsed separately from the rest of the document.
If premonition fixes this issue, I would be happy to archive/deprecate my plugin and recommend premonition instead.
@MaximeKjaer Cool, I will definitely look into this!
If you are interested, I'll be happy to let you in on the project itself. Probably a lot of cool stuff that are yet to be added :)
Sure, I can help out on the project! Can't promise a ton of time in the coming weeks, but when I do have time, I'm up for it.
Back to the issue :)
The initial reason for rendering inside Premonition instead of a fall-through strategy, was that I needed to insert variables into the render. But I will see if I can come up with another approach.