Skip to contents

Functions for detecting and extracting shortcodes from AST nodes after the initial parsing phase.

Usage

rmd_has_shortcode(x, func_name = NULL)

rmd_extract_shortcodes(x, flatten = FALSE)

Arguments

x

An AST node, list of nodes, or character vector

func_name

character vector, optional glob patterns for matching shortcode function names. If NULL (default), matches any shortcode.

flatten

Return a flat list shortcodes if TRUE

Value

  • rmd_has_shortcode(): logical vector indicating which nodes contain shortcodes

  • rmd_extract_shortcodes(): list of shortcode objects found in the content