GithubHelp home page GithubHelp logo

buschjost / php-decoda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from milesj/decoda

1.0 2.0 0.0 864 KB

A lightweight lexical string parser for BBCode styled markup.

Home Page: http://milesj.me/code/php/decoda

PHP 100.00%

php-decoda's Introduction

Decoda v3.4

A lightweight lexical string parser for BBCode styled markup.

Compatibility

Version(s) 3.x are not backwards compatible with 2.9 and lower. The newer versions were completely rewritten as a lexical parser that examines the string stack, where as the older versions were using archaic regex parsing. The newer versions also boast a very powerful filter and hook system, so your old code will need to be changed to support the newer functionality.

Requirements

  • PHP 5.2, 5.3

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 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
  • Block: align, float, hide, alert, note, div, spoiler, left, right, center, justify
  • Code: code, var
  • Email: email, mail
  • Image: image, img
  • List: list, olist, li
  • Quote: quote
  • Text: font, size, color, h1-h6
  • Url: url, link
  • Video: video

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: http://milesj.me/code/php/decoda

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.