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 };