File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
src/Renderer/Html/LineRenderer Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,7 @@ public function render(MbString $mbOld, MbString $mbNew): LineRendererInterface
2222 static $ splitRegex = '/([ ' . RendererConstant::PUNCTUATIONS_RANGE . '])/uS ' ;
2323 static $ dummyHtmlClosure = RendererConstant::HTML_CLOSURES [0 ] . RendererConstant::HTML_CLOSURES [1 ];
2424
25- // using PREG_SPLIT_NO_EMPTY will make "wordGlues" work wrongly under some rare cases
26- // failure case:
27- // old: "good-looking-x"
28- // new: "good--y"
29- // notice that after glueing, the 2nd "-" in the new should be in the diff segment
30- $ pregFlag = \PREG_SPLIT_DELIM_CAPTURE ;
25+ $ pregFlag = \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY ;
3126 $ oldWords = $ mbOld ->toArraySplit ($ splitRegex , -1 , $ pregFlag );
3227 $ newWords = $ mbNew ->toArraySplit ($ splitRegex , -1 , $ pregFlag );
3328
You can’t perform that action at this time.
0 commit comments