Skip to content
Snippets Groups Projects
Unverified Commit 54436b19 authored by bleistivt's avatar bleistivt Committed by GitHub
Browse files

Fix zero width spaces in diffs

parent 5a361db5
No related branches found
No related tags found
No related merge requests found
......@@ -1560,7 +1560,7 @@ function html_softbreak_callback($match){
// its a long string without a breaking character,
// make certain characters into breaking characters by inserting a
// breaking character (zero length space, U+200B / #8203) in front them.
// word break opportunity (<wbr> tag) in front of them.
$regex = <<< REGEX
(?(?= # start a conditional expression with a positive look ahead ...
&\#?\\w{1,6};) # ... for html entities - we don't want to split them (ok to catch some invalid combinations)
......@@ -1570,7 +1570,7 @@ function html_softbreak_callback($match){
)+ # end conditional expression
REGEX;
return preg_replace('<'.$regex.'>xu','\0&#8203;',$match[0]);
return preg_replace('<'.$regex.'>xu','\0<wbr>',$match[0]);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment