moonheart08 / bbx

A robust, performant BBCode parser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BBX

Crates.io MSRV Crates.io License Crates.io Version docs.rs Discord

A robust and performant (constant time, no recursion) BBCode pull parser with no_std/alloc support.

Examples

Quick parsing

// Parse a document, throwing all of its component tokens into the console.
let mut parser = BBParser::new(input);

for token in parser {
    println!("{:?}", token);
}

Quick sanitized HTML output

// Simple serializer default with all of the v1.0.0 (or earlier) tags considered "core" to the library.
let mut serializer: HtmlSerializer<SimpleHtmlWriter> = 
    HtmlSerializer::with_tags(all_core_v1_tags());
let mut parser = BBParser::new(input);
println!("Document:");
println!("{}", serializer.serialize(parser));

About

A robust, performant BBCode parser.

License:MIT License


Languages

Language:Rust 100.0%