in reply to Re^2: Free Nodelet, JavaScript and PM links (words)
in thread Free Nodelet, JavaScript and PM links

Omitting most of the script

That requires that I omit most of my diagnosis. :)

No, // won't matter. Also, contrary to the HTML specification, not even -- matters (as far as PerlMonks is concerned "HTML comments" simply start with <!-- and end with -->).

Since you don't give me much to work with, I'll give you the code (that manipulates the contents of the Free Nodelet) and you can diagnose the problem:

$html =~ s{`([\[\]]|`+|(\w+)([%&\\]?)`?|.)}{ my $s= $1; if( '[' eq $s ) { $just ? '[' : '`{'; } elsif( ']' eq $s ) { $just ? ']' : '`}'; } elsif( defined $2 ) { my( $key, $suff )= ( $2, $3 ); my $val; if( $key =~ /^_./ ) { $val= $q->param($key); $val= $q->param( substr($key,1) ) if ! defined $val; } else { $key =~ s/_name$/_title/i; $val= $var{ lc $key }; } if( ! defined $val ) { $val= "`$key$suff`" } elsif( $suff eq '%' ) { $val= $q->escape($val); } elsif( $suff eq '&' ) { $val= $q->escapeHTML($val); } elsif( $suff eq '\\' ) { $val=~ s/(['"\\])/\\$1/g; } $val; } elsif( $s =~ /^`/ ) { $just ? $s : '`'.$s; } else { $just ? '`'.$s : '``'.$s; } }seg; return $html if $just; $html =~ s{(<!--.*?-->)|\[([^\[\]]{1,4096})\]}{ $1 ? $1 : handleLinks($2) }seg; $html =~ s{`([{}]|`+|.)}{ my $s= $1; if( '{' eq $s ) { '['; } elsif( '}' eq $s ) { ']'; } elsif( $s =~ /^`/ ) { $s; } else { '`'.$s; } }seg;

- tye        

Replies are listed 'Best First'.
Re^4: Free Nodelet, JavaScript and PM links (code)
by ig (Vicar) on Apr 18, 2009 at 03:58 UTC