PHPackages                             csrdelft/bb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. csrdelft/bb

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

csrdelft/bb
===========

C.S.R. BB Parser

v1.3.6(3y ago)13.4k1[2 PRs](https://github.com/csrdelft/bb/pulls)MITPHPPHP &gt;=7.3.14CI failing

Since Jul 6Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/csrdelft/bb)[ Packagist](https://packagist.org/packages/csrdelft/bb)[ Docs](https://csrdelft.github.io/bb)[ RSS](/packages/csrdelft-bb/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (23)Used By (0)

C.S.R. BB Parser
================

[](#csr-bb-parser)

This package was originally based on [eamBBParser](https://sourceforge.net/projects/eambbparser/). Some parser internals are still based on that implementation.

Installation
------------

[](#installation)

Install with composer

```
composer require csrdelft/bb

```

Usage
-----

[](#usage)

Either use the `DefaultParser` or implement your own parser.

```
$parser = new \CsrDelft\bb\DefaultParser();

echo $parser->getHtml('[h=1]Hello World[/h]');
```

### Tags

[](#tags)

The default tags available are:

Tag nameDescription`[b]`Bold text`[i]`Italic`[u]`Underline`[s]`Strikethrough`[sub]`Subscript`[sup]`Superscript`[clear]`Clear`[code]`Code block`[commentaar]`Comment`[div class=? w=? h=? float=left/right clear?]`Div`[email]`Email`[h]`Header`[hr]`Horizontal rule`[1337]`Leet speak`[lishort]`, `[*]`List item`[list]`, `[ulist]`List`[li]`List item`[me]`/me`[rn]`New line`[nobold]`Disable `[b]``[quote]`Blockquote`[table]`Table element`[td]`Table cell`[th]`Table header`[tr]`Table Row### Custom tags

[](#custom-tags)

Tags must extend the `\CsrDelft\bb\BbTag` class. Tags must implement the `parse($arguments)` and `getTagName()` methods.

The `getTagName` method retuns a string or list of strings with the name(s) of this tag.

The `parse` method receives a map of arguments. The `readContent` method can be used to retrieve the contents of the tag, this content is parsed by the parser when it is received. The parser reads the input until an end tag is found. `readContent` has an optional parameter for tags which are forbidden to be in this tag. For instance a `[sup]`tag cannot contain another sup tag or a sub tag.

A tag has access to an environment, which is by default of type `CsrDelft\bb\BBenv` (can be overridden).

### Custom tag example

[](#custom-tag-example)

```
class BbSuperscript extends BbTag {
	public static function getTagName() {
		return 'sup';
	}

	public function render() {
		return '' . $this->getContent() . '';
	}

    public function parse($arguments = []) {
         $this->readContent(['sub', 'sup']);
       }
}
```

### Custom parser

[](#custom-parser)

A custom parser must extend `Parser` and contains a list of tags in the `$tags` field. See `DefaultParser` for the list of default tags.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance49

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 55.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~187 days

Total

20

Last Release

1211d ago

Major Versions

v1.3.3 → v2.x-dev2021-02-26

PHP version history (3 changes)v1.0PHP &gt;=7.0.33

v2.x-devPHP &gt;=7.3.19

v1.3.6PHP &gt;=7.3.14

### Community

Maintainers

![](https://www.gravatar.com/avatar/11a5c870c4f24eb721ceb7c08fd3678a65869c72f127fc88882fc0720d185df9?d=identicon)[qurben](/maintainers/qurben)

---

Top Contributors

[![qurben](https://avatars.githubusercontent.com/u/589651?v=4)](https://github.com/qurben "qurben (21 commits)")[![mathcals](https://avatars.githubusercontent.com/u/9559454?v=4)](https://github.com/mathcals "mathcals (16 commits)")[![cbasje](https://avatars.githubusercontent.com/u/45468731?v=4)](https://github.com/cbasje "cbasje (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/csrdelft-bb/health.svg)

```
[![Health](https://phpackages.com/badges/csrdelft-bb/health.svg)](https://phpackages.com/packages/csrdelft-bb)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
