Skip to content
forked from milesj/decoda

A lightweight lexical string parser for BBCode styled markup.

License

Notifications You must be signed in to change notification settings

jcrombez/Decoda

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decoda v5.1.1

A lightweight lexical string parser for BBCode styled markup.

Requirements

  • PHP 5.3
  • Composer
  • Multibyte

Compatibility

  • v3.x - PHP 5.2
  • v4.x - PHP 5.3
  • v5.x - PHP 5.3, Composer

Contributors

Features

  • Parses custom code to valid (X)HTML markup
  • Setting to make links and emails auto-clickable
  • Setting to use shorthand text for links and emails
  • Provides Filters to parse markup and custom code
  • Provides Hooks to execute callbacks during the parsing cycle
  • Provides functionality to render complex markup using a template system
  • Can censor offensive words
  • Can convert smiley faces into images
  • Basic support for localized messages
  • Supports a wide range of tags
  • Fixes incorrectly nested tags by removing the broken/unclosed tags
  • Logs errors for validation

Filters

The following filters and supported tags are available.

  • Default - b, i, u, s, sup, sub, br, hr, abbr, time
  • Block - align, float, hide, alert, note, div, spoiler, left, right, center, justify
  • Code - code, source, var
  • Email - email, mail
  • Image - image, img
  • List - list, olist, li
  • Quote - quote
  • Text - font, size, color, h1-h6
  • Url - url, link
  • Video - video, youtube, vimeo, veoh, liveleak, dailymotion, myspace, wegame, collegehumor

Hooks

The following hooks are available.

  • Censor - Censors all words found within config/censored.txt
  • Clickable - Converts all non-tag wrapped URLs and emails into clickable links
  • Emoticon - Converts all smilies found within config/emoticons.json into emoticon images

Unsupported

  • URLs that begin with www will not be converted (intentional)
  • Certain videos are not supported as their embed code does not match the URL in the address bar

Documentation

Thorough documentation can be found here: https://milesj.me/code/php/decoda

A Mootools textarea editor is also available: https://github.com/milesj/moo-decoda

About

A lightweight lexical string parser for BBCode styled markup.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%