bbob_dart 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

bbob_dart #


⚡️Blazing fast port of the BBCode parser and transformer bbob in dart.

What's currently ported? #

  • bbob_parser : parses bbcode into a ast.

Usage #

See code in exmaple folder.

What's different from the original bbob? #

bbob_dart is written in dart, which has a sound type system. And with the help of dart, bbob_dart is strongly typed.

I want to render ast into html/markdown... #

You have two ways to render:

  1. Similar to, how bbob renders ast into html.

  2. Similar to, bbob_dart has implemented an ast which allows you to walk through the tree using visitor pattern.

Office support in bbob_dart for a html renderer might not happen in the near future. Feel free to send a pull request if you have a well-tested implementation.

How fast it is? #

See discussions here. Performance is expected to be on par with original bbob.

Feature requests & bugs #

Since this is a port of bbob, feature requests and bug reports should preferably be reported to original bbob repo if it's not directly related to this dart implementation.

0.1.1 #

  • Improve performance so it's on par with original bbob implementation.

  • Some other minor fixes.

0.1.0 #

Initial release.

Synced bbob_parser to


import 'package:bbob_dart/bbob_dart.dart';

main() {
  const validTags = {'url'};

  var ast = parse(
    '''print [b]a[/b] [url=]hello world![/url]
  Yes this\'s an exampe''',
    onError: (msg) {
    openTag: '[',
    closeTag: ']',
    enableEscapeTags: false,
    validTags: validTags,

  /// Parsed ast. Note that `b` is parsed as text because
  /// it's not in [validTags].
  ///[Text{text: 'print'}, Text{text: ' '}, Text{text: '[b]'}, Text{text: 'a'},
  ///Text{text: '[/b]'}, Text{text: ' '},
  ///Element{tag: 'url', attributes: '{}',
  ///children: [Text{text: 'hello'}, Text{text: ' '}, Text{text: 'world!'}]},
  ///Text{text: '
  //'}, Text{text: '  '}, Text{text: 'Yes'}, Text{text: ' '},
  // Text{text: 'this's'}, Text{text: ' '}, Text{text: 'an'}, Text{text: ' '},
  // Text{text: 'exampe'}]

  /// Each [Node] has a [Node.textContent] which can be used to access its
  /// content in raw text format.
  ast.forEach((node) => print(node.textContent));

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  bbob_dart: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:bbob_dart/bbob_dart.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0-dev.0.5.flutter-a1668566e5 <3.0.0
meta ^1.1.6 1.1.8
Dev dependencies
path ^1.3.1
pedantic ^1.0.0
quiver ^2.0.2
test ^1.0.0