Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Replace Markdown Image ![]() Code

Started by finrik 8 years ago · 1 replies · 778 views
8 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!

8 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
2 249 4 days ago
Plugins · by Vladimir Novak, 1 month ago
3 594 1 month ago
Plugins · by Mathieu Lecouturier, 2 months ago
3 416 2 months ago
Plugins · by Slebeig, 2 months ago
1 530 2 months ago
Plugins · by Rene, 3 months ago
2 730 3 months ago