Refactoring

This commit is contained in:
M66B
2021-06-02 07:54:14 +02:00
parent 9db632d2f5
commit a2d4bec70c
2 changed files with 15 additions and 11 deletions

View File

@@ -1989,6 +1989,20 @@ public class HtmlHelper {
}
}
static void quoteLimit(Document d, int maxLevel) {
for (Element bq : d.select("blockquote")) {
int level = 1;
Element parent = bq.parent();
while (parent != null) {
if ("blockquote".equals(parent.tagName()))
level++;
parent = parent.parent();
}
if (level >= maxLevel)
bq.html("…");
}
}
static boolean truncate(Document d, int max) {
final int[] length = new int[1];