From fa48de33c2f6cefbac8bfec7cde75b75390d5f39 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 15 Jun 2016 19:44:15 -0700 Subject: provide syntax based [colour] highlighting on code blocks for popular languages. I'm not happy with the line height on the list elements but couldn't see where this was defaulted. This uses the syntax [code=xxx]some code snippet[/code], where xxx represents a code/language style - with about 18 builtins. --- library/Text_Highlighter/Text/Highlighter/HTML.php | 234 +++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 library/Text_Highlighter/Text/Highlighter/HTML.php (limited to 'library/Text_Highlighter/Text/Highlighter/HTML.php') diff --git a/library/Text_Highlighter/Text/Highlighter/HTML.php b/library/Text_Highlighter/Text/Highlighter/HTML.php new file mode 100644 index 000000000..14d0a783f --- /dev/null +++ b/library/Text_Highlighter/Text/Highlighter/HTML.php @@ -0,0 +1,234 @@ + + * + */ + +/** + * @ignore + */ + +require_once 'Text/Highlighter.php'; + +/** + * Auto-generated class. HTML syntax highlighting + * + * @author Andrey Demenev + * @category Text + * @package Text_Highlighter + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version Release: @package_version@ + * @link http://pear.php.net/package/Text_Highlighter + */ +class Text_Highlighter_HTML extends Text_Highlighter +{ + var $_language = 'html'; + + /** + * PHP4 Compatible Constructor + * + * @param array $options + * @access public + */ + function Text_Highlighter_HTML($options=array()) + { + $this->__construct($options); + } + + + /** + * Constructor + * + * @param array $options + * @access public + */ + function __construct($options=array()) + { + + $this->_options = $options; + $this->_regs = array ( + -1 => '/((?i)\\