From b52cfe55bf59750005bf0a8d1eecddf37adbddfd Mon Sep 17 00:00:00 2001 From: Kirill Zhumarin Date: Tue, 29 Jun 2021 12:16:52 +0300 Subject: [PATCH] fix "Search pattern not terminated" --- CHANGES | 3 ++- lib/HTML5/DOM.pm | 2 +- lib/HTML5/DOM/Collection.pm | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index d3b660e..4464a9c 100644 --- a/CHANGES +++ b/CHANGES @@ -34,4 +34,5 @@ - update modest 2021-06-26 1.20 - fix link to issues 2021-06-26 1.21 - fix link to issues -2021-06-29 1.22 - replace re:;is_regexp to ref() check for older perl versions +2021-06-29 1.22 - replace re::is_regexp to ref() check for older perl versions +2021-06-29 1.23 - fix "Search pattern not terminated" diff --git a/lib/HTML5/DOM.pm b/lib/HTML5/DOM.pm index 4efe145..13e6166 100644 --- a/lib/HTML5/DOM.pm +++ b/lib/HTML5/DOM.pm @@ -17,7 +17,7 @@ use HTML5::DOM::Collection; use HTML5::DOM::CSS; use HTML5::DOM::TokenList; -our $VERSION = '1.22'; +our $VERSION = '1.23'; require XSLoader; # https://developer.mozilla.org/pl/docs/Web/API/Element/nodeType diff --git a/lib/HTML5/DOM/Collection.pm b/lib/HTML5/DOM/Collection.pm index 7ed33a0..e9f3dba 100644 --- a/lib/HTML5/DOM/Collection.pm +++ b/lib/HTML5/DOM/Collection.pm @@ -84,7 +84,7 @@ sub each { sub uniq { my ($self, $callback) = (shift, shift); my %used; - return HTML5::DOM::Collection->new([grep { !$used{$_->$callback(@_) // ''}++ } @$self]) if ($callback); + return HTML5::DOM::Collection->new([grep { my $id = $_->$callback(@_); !$used{defined($id) ? $id : ''}++ } @$self]) if ($callback); return HTML5::DOM::Collection->new([grep { !$used{$_->hash}++ } @$self]); }