diff --git a/classes/class-wpcom-liveblog-entry-extend-feature-hashtags.php b/classes/class-wpcom-liveblog-entry-extend-feature-hashtags.php index b1baffccb..f9a051207 100644 --- a/classes/class-wpcom-liveblog-entry-extend-feature-hashtags.php +++ b/classes/class-wpcom-liveblog-entry-extend-feature-hashtags.php @@ -39,8 +39,31 @@ public function load() { // the generated hashtag class. $this->class_prefix = apply_filters( 'liveblog_hashtag_class', $this->class_prefix ); - // Set a better regex for hashtags to allow for hex values in content. - $this->set_regex( '~(?:(??)(?:(?get_prefixes() ) . ')([0-9_\-\p{L}]*))~um' ); + $prefixes = implode( '|', $this->get_prefixes() ); + + // Set a better regex for hashtags to allow for hex values in content -- see https://regex101.com/r/CLWsCo/ + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- ignore indentation + $this->set_regex( + '~' + . '(?:' + . '(??' // possible right angle bracket(s) + . ')' + . '(?:' + . '(?