forked from Archives/Athou_commafeed
keep text only before detecting direction, use jsoup because bidiutils html stripping is too restrictive
This commit is contained in:
@@ -124,7 +124,11 @@ public class FeedUtils {
|
|||||||
|
|
||||||
public static boolean isRTL(FeedEntry entry) {
|
public static boolean isRTL(FeedEntry entry) {
|
||||||
String content = entry.getContent().getContent();
|
String content = entry.getContent().getContent();
|
||||||
Direction direction = BidiUtils.get().estimateDirection(content, true);
|
String text = Jsoup.parse(content).text();
|
||||||
|
if (StringUtils.isBlank(text)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Direction direction = BidiUtils.get().estimateDirection(text);
|
||||||
return direction == Direction.RTL;
|
return direction == Direction.RTL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user