2017 © Pedro Peláez
 

library bbcode

Simple BBCode parser

image

derokorian/bbcode

Simple BBCode parser

  • Thursday, March 3, 2016
  • by derokorian
  • Repository
  • 1 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

bbcodes

Build Status Code Climate Test Coverage, (*1)

Simple class to parse BBCodes, (*2)

Install via composer

composer require derokorian/bbcodes

Use the class

use Dero\BBCodes\BBCodes;

echo (new BBCodes)->fullClean($string);

// alternately, call clean and provide the options to use
echo (new BBCodes)->clean($string, BBCodes::OPT_LIST | BBCodes::OPT_BASIC);

// The following options exist
BBCodes::OPT_URLS
BBCodes::OPT_BASE (pre, strike, b, i, u)
BBCodes::OPT_CODE
BBCodes::OPT_LIST
BBCodes::OPT_QUOTE

BBCodes::OPT_BASIC = OPT_URLS | OPT_BASE | OPT_CODE | OPT_LIST | OPT_QUOTE

BBCodes::OPT_TITLE
BBCodes::OPT_IMG
BBCodes::OPT_NOPARSE

BBCodes::OPT_FULL = OPT_BASIC | OPT_TITLE | OPT_IMG | OPT_NOPARSE

Tags

The following tags are available, depending on the options used. Tags are not case-sensitive., (*3)

[b]bold[/b]
[i]italic[/i]
[u]underline[/u]
[strike]struck through text[/strike]

[title]some title text[/title]
[subtitle]a smallter title text[/subtitle]

[list]
    [item]list item[/item]
    [item]list item[/item]
[/list]

[url]http://example.com[/url]
[url=http://example.com]some text[/url]
[urls]block of text containing many raw urls[/urls]

[img]http://url.to/image.jpg[/img] 
[img=http://url.to/image.jpg]alt/title[/img] 

[noparse]text not to be parsed for other BBCodes[/noparse]
[quote]something attributed to someone else[/quote] 
[quote=author]something attributed to someone else[/quote] 

[pre]preformatted text[/pre]
[code]some code that needs formatting maintained[/code]

Code Tag upgrade

By default the code tag only preserves formatting, however if you require the suggested GenSynth package - then code may be modified to specify the language, (*4)

composer require derokorian/gen-synth

[code=language]code to be highlighted as the specific language[/code]

The Versions

03/03 2016

dev-master

9999999-dev

Simple BBCode parser

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Ryan Pallas

03/03 2016

v1.0.2

1.0.2.0

Simple BBCode parser

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Ryan Pallas

22/02 2016

v1.0.1

1.0.1.0

Simple BBCode parser

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Ryan Pallas

13/02 2016

v1.0.0

1.0.0.0

Simple BBCode parser

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ryan Pallas