Closed dkarlovi closed 11 months ago
According to the CommonMark spec, link text is allowed to contain other inlines (including delimiter-based ones) but link destinations are not. You can see this by testing ![foo](**emphasis**)
in several different Markdown parsers
The idea is to allow placing expressions into a MD file (say, reference assets, images which get processed in some way before rendering the Markdown).
Ah! For that case I'd highly recommend performing that pre-processing before parsing the Markdown (so that the expressions are actually rendered into Markdown). You could do this before passing the Markdown into this library, or by listening for the DocumentPreParsedEvent
.
Your syntax looks very similar to Twig - you could run the document through Twig first (to render the expressions) and then feed that final Markdown through here.
@colinodell thanks for the inspiration, I did consider doing it like that before, but it seemed kind of heavy handed because you go from not being able to do anything to being able to do way too much. :laughing:
I'll do it by implementing the Twig preprocessing in a sandboxed manner, meaning the Twig instance will be specifically narrowed as much as possible.
Thanks, have a good day!
That sounds like a great approach! Feel free to reach out again if you have any other questions 🙂
Version(s) affected
2.4.1
Description
This works:
This doesn't work:
How to reproduce
Register this delimiter processor
Possible solution
No response
Additional context
The idea is to allow placing expressions into a MD file (say, reference assets, images which get processed in some way before rendering the Markdown).
See https://github.com/sigwinhq/yassg/pull/181
Did this project help you today? Did it make you happy in any way?
No response