Re: Re: [PEPr] +1 for Text::Text_Highlighter
| From: | Andrey Demenev | Date: | Thu, 20 May 2004 13:39:18 +0000 |
| Subject: | Re: Re: [PEPr] +1 for Text::Text_Highlighter | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-29447@lists.php.net to get a copy of this message | ||
Bertrand Mansion wrote:
Andrey Demenev wrote:OK, will add thisPepr wrote:Yes, it would be nice to check if the required attributes are set and throw a PEAR_Error if not or incorrect. As you are using the generator only once, this is not a problem for performance.Bertrand Mansion (http://pear.php.net/user/mansion) has voted +1 on theproposal for Text::Text_Highlighter.Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=72 Vote information: http://pear.php.net/pepr/pepr-vote-show.php?id=72&handle=mansion This vote is conditional. The condition is: IMO, Some things still need to be fixed: - If end attribute is empty (end=""), generator says: Uninitialized stringoffset: 0 in /usr/lib/php/Text/Highlighter/Generator.php on line 242 What is the point of having an empty regexp? I think this should be considered an error. At present, the generator does not have any error checking. I believe error handling logic should be added to the generator. What do you think?
BTW, I haven't been able to set the generate -d option correctly (but I haven't tried really hard).generate -x diff.xml -d ./ parse diff.xml and write output to ./DIFF.php (assuming that diff.xml contains <highlighter lang="diff">) generate -x diff.xml -p DIFF.php -x javascript.xml -x python.xml -d ../ writes DIFF.xml , ../JAVASCRIPT.php and ../PYTHON.php (the directory is used for -x that are not followed by -p)
About the empty end attribute, I agree with you although I think it could be replaced automatically with newline matching if not present, this way, a whole line could be matched.I dont think we could rely on default values here, this could cause undesired behavior. IMO it is better to treat that as error
-- Andrey Demenev aka Blindman demenev@on-line.jar.ruI overlooked the option, thanks, that's a good idea. Bertrand Mansion Mamasam- I still get <ol> tags in the result when using numbers=true, beside the newtable with the numbers, that makes 2 cols of numbers (a bit too much ;) ) I have changed the type of 'numbers' option to integer. It can be : 0 (no numbering), HL_NUMBERS_LI (numbered list) or HL_NUMBERS_TABLE (table). Forgotten to reflect that in the docs.