You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if this is a Grav or a Shortcode issue or expected behavior, or if this issue is related, but I'll describe the scenario:
I need to do some parsing to the page content before rendering in markdown, so:
I've disabled markdown in the frontmatter
then I do some content splitting and parsing in twig in the template
and then finally render the split parts using twig |markdown filter
Problem is that, even with markdown extra, content inside shortcodes (such as [div]…[/div]) then won't get rendered in markdown.
I've tried newlines etc., but at the moment the workaround looks like this:
---
process:
markdown: false
---
[div]{{"
### Markdown content here
I'm an ugly workaround
"|markdown}}[/div]
…which works, but defeats the purpose of the exercise, which is to create complex long-pagers with a single, minimal markdown document with unobtrusive section dividers, a bit like the example in the docs where you render content separated by ---'s in columns, but I'm adding some parsing to throw some id's/classes in, too.
The text was updated successfully, but these errors were encountered:
The fundamental problem here is that by using the markdown filter, you are doing that manually in Twig, and that means you are doing it after the shortcodes have run.
You really need to do any markdown processing first while the shortcode tags are still in the content, because markdown will not process any syntax between HTML tags.
Your approach is to do the shortcodes first (on content), and then try to process markdown, which is resulting in the the markdown between those html
tags the shortcodes have rendered, which won't work.
Thanks for the clarification. I realized that markdown=“1” will solve the problem in a satisfactory manner. I really need to do parsing this complex in a plugin with php instead of inside the template with twig, but there’s some learning I need to do first.
I wonder if this is a Grav or a Shortcode issue or expected behavior, or if this issue is related, but I'll describe the scenario:
I need to do some parsing to the page content before rendering in markdown, so:
|markdown
filterProblem is that, even with markdown extra, content inside shortcodes (such as
[div]…[/div]
) then won't get rendered in markdown.I've tried newlines etc., but at the moment the workaround looks like this:
…which works, but defeats the purpose of the exercise, which is to create complex long-pagers with a single, minimal markdown document with unobtrusive section dividers, a bit like the example in the docs where you render content separated by
---
's in columns, but I'm adding some parsing to throw some id's/classes in, too.The text was updated successfully, but these errors were encountered: