PHPackages                             bilge/nbbc - 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. bilge/nbbc

ActiveLibrary

bilge/nbbc
==========

A composer-compatible fork of the NBBC BBCode parsing library.

4.0.0(1mo ago)019↑1478.9%BSD-2-ClausePHPPHP ^8.2CI passing

Since Jan 11Pushed 1mo agoCompare

[ Source](https://github.com/Bilge/nbbc)[ Packagist](https://packagist.org/packages/bilge/nbbc)[ RSS](/packages/bilge-nbbc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (16)Used By (0)

The New BBCode Parser (NBBC)
============================

[](#the-new-bbcode-parser-nbbc)

[![Build Status](https://camo.githubusercontent.com/7297e3c0618c7776f241db53c032d16327b0524521a2cf1baf4b0f937966e0e2/68747470733a2f2f636972636c6563692e636f6d2f67682f76616e696c6c612f6e6262632e7376673f7374796c653d737667)](https://app.circleci.com/pipelines/github/vanilla/nbbc)[![Packagist Version](https://camo.githubusercontent.com/f93db1f7d04d0734a448705b4e590b8bb270ce53f48c87a88f00b66d43df4127/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616e696c6c612f6e6262632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vanilla/nbbc)

Overview
--------

[](#overview)

NBBC is a high-speed, extensible, easy-to-use validating BBCode parser that accepts BBCode as input and generates XHTML 1.0 Transitional-compliant markup as its output no matter how mangled the input. It includes built-in support for most common BBCode, as well as external-wiki support, image-library support, a standard library of smileys (emoticons), and via its powerful API it can even be transformed into a validating HTML parser!

NBBC is well-tested, with its output validated against a unit-test suite with over a hundred different tests. It is written entirely in PHP, using clean, namespace-friendly, object-oriented code, and it is compatible with PHP 7.1 and up.

While flexible and powerful, NBBC is also designed to be an easy to use, and is an easy drop-in replacement for most existing BBCode-parsing solutions. In many cases, it can be implemented in your own projects with only two or three lines of code. Only a single PHP source file is necessary in your projects, a compact, optimized file that is automatically generated from the included heavily-commented original PHP source files.

Unlike many open-source packages, it's well-documented, too! With over 50 printed pages of documentation, including a programmer's manual with many examples, and a fully-documented API, you'll never be lost using it.

NBBC is released under a BSD Open-Source License, and may be freely used in any project for any purpose, commercial, noncommercial, or otherwise. It was created from its author's frustration in dealing with the dubious quality of similar products.

In short, NBBC is the package you want for implementing BBCode on your site.

Changes between NBBC v2.x and v1.x
----------------------------------

[](#changes-between-nbbc-v2x-and-v1x)

Version 2.x breaks backwards-compatibility very slightly with the 1.x version of NBBC, which is why it has been given a major version-number update, even though no significant functionality has been added. Here are a summary of the differences:

- All core classes have been moved into the `Nbbc` namespace to support PSR-4 autoloading and become a full composer library.
- PHP 4 is no longer supported. The minimum version of PHP required is now PHP 5.4.
- All properties on the `BBCode` class have been protected and must now be accessed with getters/setters.
- The URL auto-detection has been rewritten. It supports more general cases, but it has removed support for some edge cases such as email addresses with an IP address domain.
- Images and smileys no longer check to see if files exist locally. This removes auto-generated image sizes too.

In addition to these backwards-compatibility breaking changes, there have been a few other changes that should not break backwards compatibility:

- Tests have been moved into a PHPUnit test suite.
- Calls to the `EmailAddressValidator` have been replaced with PHP's `filter_var()` function.
- Calls to the `Profiler` have been removed from the `BBCode` class. There are plenty of profiling tools out there now that don't bloat the code.
- The `@` error silencing operator has been removed wherever possible.

Credits
-------

[](#credits)

- NBBC was originally developed by [Sean Werkema](https://github.com/seanofw) in 2008-10, and most of the core code is his. He last officially worked on it in September 2010, after which it sat dormant for a few years while he did Other Things, mostly involving Gainful Employment and Wife and Kids. His last commit was on v1.4.5.
- [Theyak](https://github.com/theyak) imported it from SourceForge into Github in 2013, and did some maintenance work, fixing bugs and adding some minor enhancements from 2013-5. The Git history of this repository dates back to this point, condensing the prior Subversion history to a single commit.
- The [Vanilla Forums Team](https://github.com/vanilla) did some major work to upgrade Theyak's copy of NBBC to support modern PHP 5/6/7, and they're responsible for v2.x and later versions.

License
-------

[](#license)

As noted above, most of the NBBC was written by Sean Werkema and the copyright on that code remains his. There are files that also have a copyright assigned to Vanilla Forums Inc. That additional copyright only applies to the changes made by Vanilla Forums Inc.

This library will always be licensed under the BSD v2 open-source license, a copy of which can be found below:

> Copyright © 2008-10, Sean Werkema. All rights reserved.
>
> Portions copyright © Vanilla Forums Inc. All rights reserved.
>
> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
>
> - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
> - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
>
> THIS SOFTWARE IS PROVIDED BY SEAN WERKEMA AND VANILLA FORUMS INC. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~266 days

Recently: every ~177 days

Total

15

Last Release

45d ago

Major Versions

v2.6.0 → v3.0.02025-09-16

3.0.1 → 4.0.02026-03-25

PHP version history (3 changes)v2.0.0PHP &gt;=5.4.0

v3.0.0PHP &gt;=7.1.0

3.0.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/470626?v=4)[Bilge](/maintainers/Bilge)[@Bilge](https://github.com/Bilge)

---

Top Contributors

[![tburry](https://avatars.githubusercontent.com/u/97432?v=4)](https://github.com/tburry "tburry (73 commits)")[![theyak](https://avatars.githubusercontent.com/u/211792?v=4)](https://github.com/theyak "theyak (40 commits)")[![djmattyg007](https://avatars.githubusercontent.com/u/489338?v=4)](https://github.com/djmattyg007 "djmattyg007 (16 commits)")[![hemberger](https://avatars.githubusercontent.com/u/846186?v=4)](https://github.com/hemberger "hemberger (12 commits)")[![charrondev](https://avatars.githubusercontent.com/u/1770056?v=4)](https://github.com/charrondev "charrondev (11 commits)")[![DaazKu](https://avatars.githubusercontent.com/u/2412909?v=4)](https://github.com/DaazKu "DaazKu (11 commits)")[![acharron-hl](https://avatars.githubusercontent.com/u/146114816?v=4)](https://github.com/acharron-hl "acharron-hl (10 commits)")[![linc](https://avatars.githubusercontent.com/u/117672?v=4)](https://github.com/linc "linc (3 commits)")[![initvector](https://avatars.githubusercontent.com/u/1390241?v=4)](https://github.com/initvector "initvector (3 commits)")[![jdreesen](https://avatars.githubusercontent.com/u/424602?v=4)](https://github.com/jdreesen "jdreesen (2 commits)")[![Bilge](https://avatars.githubusercontent.com/u/470626?v=4)](https://github.com/Bilge "Bilge (2 commits)")[![seanofw](https://avatars.githubusercontent.com/u/981716?v=4)](https://github.com/seanofw "seanofw (2 commits)")[![hammermaps](https://avatars.githubusercontent.com/u/1943606?v=4)](https://github.com/hammermaps "hammermaps (1 commits)")[![Jaynator495](https://avatars.githubusercontent.com/u/13039635?v=4)](https://github.com/Jaynator495 "Jaynator495 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bilge-nbbc/health.svg)

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

PHPackages © 2026

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