Skip to content

Instantly share code, notes, and snippets.

@ushis
Created September 13, 2011 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ushis/1215513 to your computer and use it in GitHub Desktop.
Save ushis/1215513 to your computer and use it in GitHub Desktop.
Basic usage of the output class
<?php
# Uses the default rules
echo Output::parse($input);
echo Output::factory($input)->get();
# Remove some rules
echo Output::factory($input)->remove_rules(array('em', 'strong'))->get();
# Add and update some rules
echo Output::factory($input)
->update_rules(array(
'underline' => array('/\_+\s*([^\_\n]*[^\_\s])\s*\_+/' => '<span class="underline">\1</span'),
'em' => array('/\'+\s*([^\'\n]*[^\'\s])\s*\'+/' => '<em>\1</em>'),
))
->get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment