Skip to main content

parse_text_for_quotes

Function parse_text_for_quotes 

Source
pub fn parse_text_for_quotes(content: &str) -> ParseInlineResult
Expand description

Parse text for inline formatting markup (bold, italic, monospace, etc.).

Public entry point — returns a ParseInlineResult that owns the arena the resulting InlineNodes borrow from. Callers reach the nodes via .inlines(). Each call allocates a fresh arena; memory is reclaimed when the returned value is dropped (no leaks). The returned ParseInlineResult::warnings() slice is always empty for this entry point — the quotes-only grammar never raises warnings.

§Supported Patterns

  • *bold* and **bold** (constrained/unconstrained)
  • _italic_ and __italic__
  • `monospace` and ``monospace``
  • ^superscript^ and ~subscript~
  • #highlight# and ##highlight##
  • "`curved quotes`" and '`curved apostrophe`'

§Example

use acdc_parser::parse_text_for_quotes;

let parsed = parse_text_for_quotes("This has *bold* text.");
assert_eq!(parsed.inlines().len(), 3); // "This has ", Bold("bold"), " text."