<commit_before>Library for making bbcode like markup for message boards.

You can define your own elements and chain them together, but they can only be 1 character.
Redundant elements are automatically ignored ([bb] only registers b once) and the compilers follows
rules such as not allowing block elements (like div or p) to be inside of inline elements (strong or em).

Look at test.rb and below for example usage.


chaining elements:

    "[biu]bold italic underline[|]" => "<strong><em><u>bold italic underline</u></em></strong>

you can also close multiple tags at once:

    "[b][i][u]bold italic underline[|||]" => "<strong><em><u>bold italic underline</u></em></strong>"

unclosed tags are automatically closed at the end of the text:

    "[b][i][u]bold italic underline" => "<strong><em><u>bold italic underline</u></em></strong>"

you can also define custom functions to operate on the tags:<commit_msg>added more examples to readme<commit_after>Library for making bbcode like markup for message boards.

Look at test.rb and below for example usage.


You can define your own elements and chain them together, but they can only be 1 character:

    "[biu]bold italic underline[|]" => "<strong><em><u>bold italic underline</u></em></strong>

you can also close multiple tags at once:

    "[b][i][u]bold italic underline[|||]" => "<strong><em><u>bold italic underline</u></em></strong>"

unclosed tags are automatically closed at the end of the text:

    "[b][i][u]bold italic underline" => "<strong><em><u>bold italic underline</u></em></strong>"

Redundant elements are automatically ignored:

    "[bbiiuu][b][i][u][b][i][u]text" => "<strong><em><u>text</u></em></strong>"

The compiler follows rules such as not allowing block elements to be inside of inline elements:

    "[i][q]q is blockquote" => "<em>q is blockquote</em>"

you can also define custom functions to operate on the tags:
{'fraction_non_alphanumeric': 0.1322140608604407, 'fraction_numerical': 0.001049317943336831, 'mean_word_length': 4.867692307692308, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4164830', 'n_tokens_mistral': 568, 'n_tokens_neox': 546, 'n_words': 232}