Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Replace Markdown Image ![]() Code

Started by finrik 9 years ago · 1 replies · 838 views
9 years ago

Hello

I wrote an image insert plugin: [plugin:image](). However, I would prefer to overwrite the normal markdown image code.

So that I can write instead of plugin:image and the plugin is still work.

Thank you very much for your help!

9 years ago

If you search the plugin list for markdown, you'll see a number of extender plugins that hook onto the onMarkdownInitialized event (see the Grav Lifecycle page).

I'm not seeing explicit examples of overriding existing syntax, but I presume your plugin would run first, so you could hijack any instances of ! and do your thing before standard Markdown takes over.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by complanar, 2 weeks ago
6 375 2 weeks ago
Plugins · by BenLaKnet, 2 weeks ago
1 190 2 weeks ago
Plugins · by complanar, 1 month ago
2 470 4 weeks ago
Plugins · by Vladimir Novak, 2 months ago
3 749 2 months ago
Plugins · by Mathieu Lecouturier, 2 months ago
3 588 2 months ago