An open API service indexing awesome lists of open source software.

https://github.com/moonheart08/bbx

A robust, performant BBCode parser.
https://github.com/moonheart08/bbx

bbcode rust

Last synced: about 1 year ago
JSON representation

A robust, performant BBCode parser.

Awesome Lists containing this project

README

          

# BBX
![Crates.io MSRV](https://img.shields.io/crates/msrv/bbx)
![Crates.io License](https://img.shields.io/crates/l/bbx)

![Crates.io Version](https://img.shields.io/crates/v/bbx)


![docs.rs](https://img.shields.io/docsrs/bbx)


![Discord](https://img.shields.io/discord/1170413428393902170?link=https%3A%2F%2Fdiscord.gg%2FChVzW85C)

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

# Examples
## Quick parsing
```rs
// 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
```rs
// Simple serializer default with all of the v1.0.0 (or earlier) tags considered "core" to the library.
let mut serializer: HtmlSerializer =
HtmlSerializer::with_tags(all_core_v1_tags());
let mut parser = BBParser::new(input);
println!("Document:");
println!("{}", serializer.serialize(parser));
```