[Lxr-dev] [ lxr-Bugs-3089456 ] variables span or class yeild nested tag ugliness
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2011-03-04 18:07:43
|
Bugs item #3089456, was opened at 2010-10-18 03:49 Message generated for change (Comment added) made by ajlittoz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3089456&group_id=27350 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lang support Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Marc W. Mengel (mengel) Assigned to: Nobody/Anonymous (nobody) Summary: variables span or class yeild nested tag ugliness Initial Comment: If you cross-reference C code that has variable "span" the markup engine first puts <span class='reserved'>typedef</span> and then the identifier markup turns that into <<a href="...ident?i=span">span</a> class='reserved'>typedef</span> If you have a program with all 3 of "span", "class" and "reserved" as variables, the results are particualrly special. I've worked around this somewhat by hacking up Generic.pm with the following patch, but there are still a few such instances leaking through... *** Generic.pm.orig 2010-09-27 11:35:23.000000000 -0500 --- Generic.pm 2010-10-17 13:09:59.000000000 -0500 *************** *** 155,168 **** $self->processreserved($code); ! # Replace identifier by link unless it's a reserved word $$code =~ s{ ! (^|[^\$\w\#])([-\w~\#][\w]*)\b } { $1. ! ( $index->issymbol($2, $$self{'releaseid'}) ? join($2, @{$$self{'itag'}}) : $2 ); }gex; } --- 155,168 ---- $self->processreserved($code); ! # Replace identifier by link unless it's a reserved word or part of a span tag from above... $$code =~ s{ ! ((?:\s*<span.*?>.*?</span>\s*)+|[^\$\w\#]|^)([-\w~\#]?[\w]*)\b } { $1. ! ((! $self->isreserved($2) && $index->issymbol($2, $$self{'releaseid'})) ? join($2, @{$$self{'itag'}}) : $2 ); }gex; } ---------------------------------------------------------------------- Comment By: Andre-Littoz (ajlittoz) Date: 2011-03-04 19:07 Message: The same behaviour happens with processinclude if filename looks like a reserved word or contains a pathological variable like above. Thus it deserves the same kind of correction. As you noticed, your proposed patch leaves some leaks. I tackled the issue on a different principle: in my opinion, the cause is the multi-pass nature of the replacements/taggings. All must be done simultaneously to prevent the mis-behaviour. Take a look to the help forum where I posted the whole bunch of my patches under topic 'Help on non regression' as I'd like someone to check these on different data than mine. Regards, Pat ---------------------------------------------------------------------- Comment By: Marc W. Mengel (mengel) Date: 2010-10-18 16:46 Message: Attached a patch which seems to work reliably now. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3089456&group_id=27350 |