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.
- Host: GitHub
- URL: https://github.com/moonheart08/bbx
- Owner: moonheart08
- License: mit
- Created: 2024-04-30T11:18:16.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T23:36:07.000Z (almost 2 years ago)
- Last Synced: 2025-02-08T12:38:53.897Z (about 1 year ago)
- Topics: bbcode, rust
- Language: Rust
- Homepage:
- Size: 88.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BBX





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));
```