-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow nested shortcodes #2748
Allow nested shortcodes #2748
Conversation
Oh, another thing, I noticed that when it comes to MD shortcodes calling HTML shortcodes, the HTML shortcode must be multi-line otherwise its result will get wrapped in a |
Not sure honestly. Sounds like a bug maybe? |
I... Actually don't think so, iirc if you have a single line with a |
Applied the feedback given, lmk what you think! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes #515
Hello, and Happy Christmas 🎄
This PR iterates on #2630 with the given feedback of not requiring the use of the
markdown
filter to execute nested shortcodes. Additionally, unlike the previous PR, nested nth invocation increments follows a more intuitive pattern.Before:
After:
Sanity check:
Code changes
ShortcodeInvocationCounter
has been addedmarkdown::shortcode::parser::Shortcode
struct now hasinner: Vec<Shortcode>
markdown::shortcode::parser::parse_for_shortcodes
function now also parses shortcode bodiesflatten
method tomarkdown::shortcode::parser::Shortcode
which renders the inner-shortcodes into the shortcode bodyrender
method onmarkdown::shortcode::parser::Shortcode
now callsflatten
next
branch?If the change is a new feature or adding to/changing an existing one:
Let me know what you think!