PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Text » Text_Highlighter » Bug #6588

HTML Renderer feature: language specific class

Details

Request #6588HTML Renderer feature: language specific class
Submitted2006-01-25 23:00 UTC
Fromsimp at php dot net
Assignedblindman
StatusClosed
PackageText_Highlighter
PHP VersionIrrelevant
OSn/a
Roadmaps(Not assigned)

Comments

[2006-01-25 23:00 UTC] simp at php dot net

Description:
------------
The HTML Renderer uses css classes to enable different language tokens to be rendered differnetly. It uses classes within the same "namespace" for each language, though. This patch enables (but not requires) the user to have language specific css classes for tokens so he can have different languages rendered differently.

Test script:
---------------
not a test script, patch for the feature:
52,53c52,55
< * - 'numbers' - Line numbering style 0 or {@link HL_NUMBERS_LI} or {@link HL_NUMBERS_TABLE}
< * - 'tabsize' - Tab size
---
> * - 'numbers' - Line numbering style 0 or {@link HL_NUMBERS_LI} or {@link HL_NUMBERS_TABLE}
> * - 'tabsize' - Tab size
> * - 'language' - Language highlighted - if this is not empty the contained string will be added
> * to all HTML SPAN style classes
148a151,156
>
> $lang = '';
> if(isset($this->_options['language']) && strlen($this->_options['language']) > 0) {
> $lang = $this->_options['language'];
> }
>
154c162,167
< $tag .= '<span class="hl-' . $class . '">';
---
> if($lang == '')
> {
> $tag .= '<span class="hl-' . $class . '">';
> } else {
> $tag .= '<span class="hl-' . $lang . '-' . $class . '">';
> }
162c175,179
< $tag = "</span>\n<span class=\"hl-" . $class . '">';
---
> if($lang == '') {
> $tag = "</span>\n<span class=\"hl-" . $class . '">';
> } else {
> $tag = "</span>\n<span class=\"hl-" . $lang . "-" . $class . '">';
> }

[2006-02-03 23:35 UTC] blindman at php dot net

Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/Text_Highlighter