package xm::listing;
use strict;
use xm::o;
use xm::sub;
"
will look for all texts that are inside <whateverListing>-markups
and replace the inner with their xm::off version of being
purely literal as a whole.
"}
my $in = shift;
my $x = sub {
my ($a,$b) = @_;
if ($b !~ m/<CPRE>\s*\#\s*include\b/s)
{
return $a.$b;
}else{
return $a."<ITEMINCL>".$b."</ITEMINCL>";
}
};
$in =~ s{(<(\w+Listing)(?:\s[^<>]*)?>(?!</?\2[\s>]))
( (?:.(?!</?\2[\s>]))*. )(</\2[\s>])
}
{
$1.&xm::sub::off($3).$4
}gsex;
$in =~ s{(<(\w+LISTING)(?:\s[^<>]*)?>(?!</?\2[\s>]))
( (?:.(?!</?\2[\s>]))*. )(</\2[\s>])
}
{
$1.&xm::sub::off($3).$4
}gsex;
return $in;
}
return xm::o::args_stdin(@_, DESC); }
return DO(xm::o::args_stdin(@_, DESC)); }
1;