<commit_before>[![Build Status](https://travis-ci.org/golonka/BBCodeParser.png?branch=master)](https://travis-ci.org/golonka/BBCodeParser)

# BBCodeParser
BBCodeParser is a standalone library that parses all(?) the common bbcode tags.
The easiest way to install is via composer and is equally as easy to integrate into Laravel 4

The available tags are:

- [b][/b] Bold
- [i][/i] Italic
- [u][/u] Underline
- [s][/s] Line through
- [size=4][/size] Font size
- [color=#eee][/color] Font color
- [center][/center] Center
- [quote][/quote] Quote
- [quote=<NAME>][/quote] Named quote
- [url][/url] Link
- [url=http://example.com]Link to example.com[/url] Named link
- [img]http://example.com/logo.png[/img] Image
- [list=1][/list] Ordered list (numerical)
- [list=a][/list] Ordered list (alphabetically)
- [list][/list] Unordered list
- [*] List item
- [code][/code] Code
- [youtube][/youtube] Youtube

## Installation

The easiest way to install the BBCodeParser library is via composer.
If you don´t now what composer is or how you use it you can find more information about that at [their website](http://www.getcomposer.org/).

### Composer

You can find the BBCodeParser class via [Packagist](https://packagist.org/packages/golonka/bbcodeparser).
Require the package in your `` composer.json `` file.

    "golonka/bbcodeparser": "1.3"

Then you run install or update to download your new requirement

    php composer.phar install

or

    php composer.phar update

Now you are able to require the vendor/autoload.php file to PSR-0 autoload the library.<commit_msg>Reformat tag demonstration<commit_after>[![Build Status](https://travis-ci.org/golonka/BBCodeParser.png?branch=master)](https://travis-ci.org/golonka/BBCodeParser)

# BBCodeParser
BBCodeParser is a standalone library that parses all(?) the common bbcode tags.
The easiest way to install is via composer and is equally as easy to integrate into Laravel 4

The available tags are:

BBCode markup                                | Result                                                  | GitHub representation (if available)
-------------------------------------------- | ------------------------------------------------------- | -------------------------------
[b]Bold[/b]                                  | `<strong>Bold</strong>`                                 | **Bold**
[i]Italic[/i]                                | `<em>Italic</em>`                                       | *Italic*
[u]Underline[/u]                             | `<u>Underline</u>`                                      | <u>Underline</u>
[s]Strike[/s]                                | `<strike>Strike</strike>`                               | ~~Strike~~
[code]Code[/code]                            | `<code>Code</code>`                                     | `Code`
[quote]Quote[/quote]                         | `<blockquote>Quote</blockquote>`                        | <blockquote>Quote</blockquote>
[quote=NN]Named quote[/quote]                | `<blockquote><small>NN</small>Named quote</blockquote>` | NN<blockquote>Named quote</blockquote>
[url]URL[/url]                               | `<a href="URL">URL</a>`                                 | <http://example.com/>
[url=URL]Link[/url]                          | `<a href="URL">Link</a>`                                | [Link](http://example.com/)
[img]URL[/img]                               | `<img src="URL">`                                       |
[size=4]Size[/size]                          | `<font size="4">Size</font>`                            |
[color=#eca]Color[/color]                    | `<font color="#eca">Color</font>`                       |
[center]Centered[/center]                    | `<div style="text-align:center;">Centered</div>`        | <p align="center">Centered</p>
Unordered list: [list][/list]                | `<ul></ul>`                                             |
Numerically ordered list: [list=1][/list]    | `<ol></ol>`                                             |
Alphabetically ordered list: [list=a][/list] | `<ol type="a"></ol>`                                    |
[*]List item                                 | `<li>List item`                                         |
[youtube]Youtube-ID[/youtube]                | `<iframe width="560" height="315" src="//www.youtube.com/embed/Youtube-ID" frameborder="0" allowfullscreen></iframe>` |

## Installation

The easiest way to install the BBCodeParser library is via composer.
If you don´t now what composer is or how you use it you can find more information about that at [their website](http://www.getcomposer.org/).

### Composer

You can find the BBCodeParser class via [Packagist](https://packagist.org/packages/golonka/bbcodeparser).
Require the package in your `` composer.json `` file.

    "golonka/bbcodeparser": "1.3"

Then you run install or update to download your new requirement

    php composer.phar install

or

    php composer.phar update

Now you are able to require the vendor/autoload.php file to PSR-0 autoload the library.
{'fraction_non_alphanumeric': 0.15657868624727128, 'fraction_numerical': 0.0039690414764834295, 'mean_word_length': 1.807799442896936, 'pattern_counts': {'":': 2, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 6, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '848094', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1375, 'n_words': 370}