Skip to main content

is_template_directive_only

Function is_template_directive_only 

Source
pub fn is_template_directive_only(line: &str) -> bool
Expand description

Check if a line consists only of a template directive with no surrounding text.

Detects template syntax used in static site generators:

  • Handlebars/mdBook/Mustache: {{...}}
  • Jinja2/Liquid/Jekyll: {%...%}
  • Hugo shortcodes: {{<...>}} or {{%...%}}

Template directives are preprocessor instructions that should not be merged into surrounding paragraphs during reflow.