From: John Napiorkowski Date: Fri, 25 Feb 2011 02:35:28 +0000 (-0500) Subject: a bit of code reformatting X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5eda5b9b7d9473042a1fe95489aebbf004f35ed;p=catagits%2FHTML-Zoom.git a bit of code reformatting --- diff --git a/t/tags_as_zoom_events.t b/t/tags_as_zoom_events.t index f7c047c..f70cb2f 100644 --- a/t/tags_as_zoom_events.t +++ b/t/tags_as_zoom_events.t @@ -71,22 +71,29 @@ use HTML::Zoom; sub _convert_to_events { map { - ## TODO: This seems quite fragile my $raw = ref $_ ? (ref $_ eq 'SCALAR' ? $$_: "$_") : $_; - my @info = ($raw =~m{ - ( - (?:[^<]*) < (?: - ( / )? ( [^/!<>\s"'=]+ ) - ( (?:"[^"]*"|'[^']*'|[^"'<>])+? )? - | - (!-- .*? -- | ![^\-] .*? ) - ) (\s*/\s*)? > - ) - ([^<]*) - }x); + my @info = ( + $raw =~m{ + ( + (?:[^<]*) < (?: + ( / )? ( [^/!<>\s"'=]+ ) + ( (?:"[^"]*"|'[^']*'|[^"'<>])+? )? + | + (!-- .*? -- | ![^\-] .*? ) + ) (\s*/\s*)? > + ) + ([^<]*) + }x + ); - my ($whole, $is_close, $tag_name, $attrs, $comment_or_directive, - $in_place_close) = @info; + my ( + $whole, + $is_close, + $tag_name, + $attrs, + $comment_or_directive, + $in_place_close + ) = @info; if($comment_or_directive) { +{ type => 'SPECIAL', raw => $raw };