parse_inline

Function parse_inline 

Source
pub fn parse_inline(
    input: &str,
    options: &Options,
) -> Result<Vec<InlineNode>, Error>
Expand description

Parse inline AsciiDoc content from a string.

This function parses the provided string as inline AsciiDoc elements, returning a vector of inline nodes instead of a complete document structure. This is useful for parsing fragments of AsciiDoc content that contain inline markup like emphasis, strong text, links, macros, and other inline elements.

NOTE: This function exists pretty much just for the sake of the TCK tests, which rely on an “inline” type output.

§Example

use acdc_parser::{Options, SafeMode, parse_inline};

let options = Options::builder()
    .with_safe_mode(SafeMode::Unsafe)
    .build();
let content = "This is *strong* text with a https://example.com[link].";
let inline_nodes = parse_inline(content, &options).unwrap();

§Errors

This function returns an error if the inline content cannot be parsed.