Merge pull request #489 from jwatt/next

Remove unmatchable rules from render_shortcodes
This commit is contained in:
Vincent Prouillet 2018-10-19 14:11:41 +02:00 committed by GitHub
commit e2b0ad47c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,7 +149,7 @@ pub fn render_shortcodes(content: &str, context: &RenderContext) -> Result<Strin
// We have at least a `page` pair
for p in pairs.next().unwrap().into_inner() {
match p.as_rule() {
Rule::text | Rule::text_in_ignored_body_sc | Rule::text_in_body_sc => res.push_str(p.into_span().as_str()),
Rule::text => res.push_str(p.into_span().as_str()),
Rule::inline_shortcode => {
let (name, args) = parse_shortcode_call(p);
res.push_str(&render_shortcode(&name, &args, context, None)?);