kirby-markdown-field
kirby-markdown-field copied to clipboard
Markdown syntax for images
Should be pickable similiar to the link button option.
Example:

@tobimori I had this idea before, but since the field does not extend the Markdown parser, we would either have to change this to have path resolution for image files or would need to resolve to some static paths here. Extending the parser is not a problem (I know a thing or two about Parsedown because I did this quite a few times), the only downside would be that this would make it harder for other plugins to extend Parsedown. Any ideas?
Similar to the solution you suggested for the highlight text, I used a kirbytags.before hook to turn this syntax into the KirbyTag. A bit hacky but it works.
I don't think extending Parsedown would be an issue if the plugin extensions could support extending the Parsedown stuff.
If you use Markdown this will be the backbone of your site, so it all has to work with the plugin anyway.
tbh, what confused me working with this plugin is, that this syntax seemingly gets resolved but the images do not work (because they are relative to the content folder and not the resolved urls)
in an optimal solution i would be able to customize this with a snippet or something that gets rendered
@tobimori Like I said before, this plugin only provides a Markdown field an nothing else. I did not want it to interfere with Kirby’s Markdown parser, because this would break other people’s Parsedown extensions or would make it much harder to switch the Markdown parser …
The most practial solution that would not require anything in the backend to change would probably to let images resolve to their absolute path, which would no require any additional backend processing, e.g. . Of course this does not optimize images or do any other cool stuff and would break if you move the site to a subfolder, but anything else would require us to change the Markdown processor. What do you think?