• Stars
    star
    164
  • Rank 229,217 (Top 5 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight but extensible BBCode parser

jBBCode

GitHub release Software License Build Status

jBBCode is a bbcode parser written in php 5.3. It's relatively lightweight and parses bbcodes without resorting to expensive regular expressions.

Documentation

For complete documentation and examples visit jbbcode.com.

A basic example

jBBCode includes a few optional, default bbcode definitions that may be loaded through the DefaultCodeDefinitionSet class. Below is a simple example of using these codes to convert a bbcode string to html.

<?php
require_once "/path/to/jbbcode/Parser.php";

$parser = new JBBCode\Parser();
$parser->addCodeDefinitionSet(new JBBCode\DefaultCodeDefinitionSet());

$text = "The default codes include: [b]bold[/b], [i]italics[/i], [u]underlining[/u], ";
$text .= "[url=http://jbbcode.com]links[/url], [color=red]color![/color] and more.";

$parser->parse($text);

print $parser->getAsHtml();

Composer

You may load jBBCode via composer. In your composer.json file:

"require": {
    "jbbcode/jbbcode": "1.3.*"
}

In your php file:

require 'vendor/autoloader.php';

$parser = new JBBCode\Parser();

Contribute

I would love help maintaining jBBCode. Look at open issues for ideas on what needs to be done. Before submitting a pull request, verify that all unit tests still pass.

Running unit tests

To run the unit tests, ensure that phpunit is installed, or install it through the composer dev dependencies. Then run phpunit from the project directory. If you're adding new functionality, writing additional unit tests is a great idea.

License

The project is under MIT license. Please see the license file for details.

More Repositories

1

codenames

Play codenames online
Go
618
star
2

request-catcher

A tool for debugging and testing webhooks, HTTP clients, etc.
Go
110
star
3

codenamesgreen

Co-op codenames app (ala Codenames Duet)
Elm
25
star
4

covplot

Live graphs of worldwide CoVID-19 data
Rust
21
star
5

nbagame

A Go client to retrieve NBA statistics from stats.nba.com.
Go
14
star
6

google-ngrams-scraper

Scrapes n-gram frequencies from Google's Ngram Viewer.
Python
6
star
7

assets

Basic asset management for Go apps
Go
4
star
8

food-truck-magic

:vomit:
JavaScript
3
star
9

www

Personal website
Go
3
star
10

events

drop-in boltdb event logging
Go
3
star
11

muni-display

A tablet display for MUNI departures, written in 100% Go
Go
3
star
12

taboo-ios

iOS tababooboo
Objective-C
2
star
13

lock-free-queue

fuck locks. it's all about that compare and swap
C
2
star
14

xbl

Client for the Xbox LIVE Smartglass app's API
Go
2
star
15

flask-gamertagchecker

The gamertagchecker.com backend
Python
2
star
16

pita-client

My Little PITA iOS client
Objective-C
2
star
17

esprit

plz don't use
PHP
2
star
18

peernote

Peernote in Python using Flask.
JavaScript
2
star
19

postcards2dianne

command-line interface to send postcards to Dianne Feinstein #resist
Go
2
star
20

lsm

Learning about log-structured merge trees; for learning only
Go
1
star
21

mixpanelcpp

Mixpanel c++ library
C
1
star
22

sunlab-organ

the return of the sunlab organ
C
1
star
23

itsawordgame.com

It's a word game.
Go
1
star
24

dictionary

A simple wrapper around the unix words file
Go
1
star
25

zippychat

The old source of ZippyChat.com
PHP
1
star
26

appleappleorange

Apple apple orange
Go
1
star
27

pita-server

The server for My Little PITA.
Python
1
star
28

dochaincore

One-click deploy of Chain Core to a DigitalOcean droplet.
Go
1
star
29

taboo

A taboo app.
Python
1
star
30

checkpassword

Check passwords offline against haveibeenpwned.com's SHA1 password list
Go
1
star
31

acs

ACS parsing
Go
1
star
32

imentropy

A small rust crate for calculating the entropy of an image.
Rust
1
star
33

pqtest

PostgreSQL databases in Go tests
Go
1
star
34

jrswish

Swish
Go
1
star