-
Notifications
You must be signed in to change notification settings - Fork 972
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
fix: shortcode in inline elements #2601
Conversation
@@ -679,7 +679,7 @@ pub fn markdown_to_html( | |||
event | |||
}); | |||
} | |||
Event::Html(text) => { | |||
Event::Html(text) | Event::InlineHtml(text) => { |
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.
Sadly it's not that easy. There is #2581 which solves both (I did miss it solved the shortcode issue sorry :() but I still don't know whether the continue reading in inline html makes sense.
To keep the fix simple, it should probably be a separate branch that doesn't contain the continue reading stuff and we can decide later if we want the full #2581
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.
You're more the welcome to copy my code and remove the continue-reading bit, FWIW. (Aimed at both amtanq/Keats if either of you want to do it first.)
Otherwise, I'll get around to it at some point.
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.
Since you have more context on it, would appreciate if you can pick this whenever you get time. LMK if you're okay with it, else would be happy to continue myself too!
Closing in favor of #2606 |
Fixes Issue: #2565
BTS
Step 1: Minimum reproducible example (to break shortcodes)
Step 2: Investigating code which references
@@ZOLA_SC_PLACEHOLDER@@
Step 3: Investigating
shortcode.render
call inmarkdown.rs
shortcode.render
was invoked for each shortcode@@ZOLA_SC_PLACEHOLDER@@
,shortcode.render
was NOT invokedhtml_shortcodes
list (which had the shortcode references even if they were not rendered)Step 4: Investigating missing shortcodes
!$range.contains(&shortcode.span.start)
skips shortcodes which are not in the rangerange
andshortcode.span
iterator(event, range)
where range -> range in the markdown sourceStep 5: Investigating ranges
Step 6: Adding a test for the issue
can_use_shortcodes_in_inline_elements
incomponents/markdown/tests/shortcodes.rs
Step 7: Fixing the issue by accounting for InlineHtml