skip shorter entities too

#WEB-17454 fixed
This commit is contained in:
Dennis Ushakov
2015-07-29 21:34:54 +03:00
parent 1bb9fe2d96
commit dd5f143019
2 changed files with 2 additions and 2 deletions
@@ -32,7 +32,7 @@ public class WordSplitter extends BaseSplitter {
}
@NonNls
private static final Pattern SPECIAL = Pattern.compile("&\\p{Alnum}{4};?|#\\p{Alnum}{3,6}|0x\\p{Alnum}?");
private static final Pattern SPECIAL = Pattern.compile("&\\p{Alnum}{2};?|#\\p{Alnum}{3,6}|0x\\p{Alnum}?");
@Override
public void split(@Nullable String text, @NotNull TextRange range, Consumer<TextRange> consumer) {
@@ -227,7 +227,7 @@ public class SplitterTest {
@Test
public void testSpecial() {
String text = "test &nbsp; test";
String text = "test &nbsp; test &sup; &gt;";
correctListToCheck(PlainTextSplitter.getInstance(), text, "test", "test");
}