Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.3

Request #4230 [Patch] Use Text_Highlighter in "code" rule
Submitted: 2005-04-27 01:28 UTC
From: davey Assigned: pmjones
Status: Assigned Package: Text_Wiki
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    

 [2005-04-27 01:28 UTC] davey
Description: ------------ Hey, Here is a patch to utilize Text_Highlighter in the <code> blocks. The tags don't change, but a lot more type=""'s are supported :) Get the patch at: It allows highlighting of all the types that Text_Highlighter currently supports. The code is similar to that which I wrote for's pastebin. It has some small conveniences, like translating the C++ type to the CPP highlighter. Aswell as converting plain text (i.e. no type) to preformated with line numbers (using <ol>). I don't know the code of Text_Wiki well enough, but I think it would be nice if the user could set an option to explicitly to use this code, so that the Text_Highlighter dependency is optional and that the CSS that is required is known to be needed. - Davey P.S. You need the CSS here from .hl-main down. Uncomment .hl-table. This'd be great in YaWiki, which is where I use it, see an example here:


 [2005-05-29 18:56 UTC] pmjones
Davey, this is awesome. Send it to me as a method of its own to be included in the Render_Xhtml_Code class and I'll put it in right away. The idea will be to switch between the current mode as "_default($options)" and your Text_Highlighter mode as "_hl($options)" based on a config setting.
 [2006-03-09 17:41 UTC] tasin at fhm dot edu (W. Tasin)
Hello, as suggested at pear-dev, here's another approach. Enabling syntaxhighlighting with Text_Highlighter. This is done in an extra class, so it shouldn't be difficult to insert the token() function in the Renderer/Xhtml/Code.php file and select Text_Highlighter with a switch (as mentioned in the posting above). It also works without patching Text_Highlighter, but for the full functionality it depends on Hope this is useful. - Walter