diff --git a/lib/class.hyphenator.php b/lib/class.hyphenator.php index bf8867a..d588037 100644 --- a/lib/class.hyphenator.php +++ b/lib/class.hyphenator.php @@ -3,8 +3,8 @@ class hyphenator { private static $hyphenators = array(); public static function hyphenate($string, $language = '') { - //Start - save html-attributes - preg_match_all('/(\S+)=["\']((?:.(?!["\']?\s+(?:\S+)=|[>"\']))+.)["\']/', $string, $matches, PREG_SET_ORDER); + //Start - save html-tags + preg_match_all('/<[^<]*>/', $string, $matches, PREG_SET_ORDER); foreach ($matches as $index => $match) { $match[0] = str_replace(['?'], ['\?'], $match[0]); $string = preg_replace('|'.$match[0].'|', '###'.$index.'###', $string, 1);