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)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 16 + 50 = ?

 
 [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: http://www.pixelated-dreams.com/~davey/PEAR/patches/Text_Wiki_Render_Xhtml_Code.txt It allows highlighting of all the types that Text_Highlighter currently supports. The code is similar to that which I wrote for hashphp.org'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: http://www.crtx.org/index.php?area=Main&page=CrtxForm

Comments

 [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. http://pc01-lsw.ee.fhm.edu/wiki/Horde/WickedAndTextHighlighter 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 http://pear.php.net/bugs/bug.php?id=7077 Hope this is useful. - Walter