Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Can a theme or plugin change markdown-parsing?

Started by Muut Archive 11 years ago · 2 replies · 309 views
11 years ago

Hi,
I want to change the default output of every default markdown table.
Is there any way to change the generated table element to include my class (e.g. "my-table-style")?

11 years ago

Yup, it's possible. I think the event you will want is onPageContentProcessed as the Markdown has been processed at this point, but the output is not yet cached. You could get the content, run some regex replacement to add your class and set it back as the page content.

You can look in the smartypants plugin to see how this is done.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1332 9 years ago
Archive · by Muut Archive, 9 years ago
2 923 9 years ago
Archive · by Muut Archive, 9 years ago
2 4053 9 years ago
Archive · by Muut Archive, 9 years ago
1 2931 9 years ago
Archive · by Muut Archive, 9 years ago
3 1109 9 years ago