HTMLFilter保留p标签

This commit is contained in:
Looly
2023-12-20 20:53:38 +08:00
parent 004d4f407d
commit 1460902eab
2 changed files with 34 additions and 1 deletions

View File

@@ -149,6 +149,8 @@ public final class HTMLFilter {
vAllowed.put("strong", no_atts);
vAllowed.put("i", no_atts);
vAllowed.put("em", no_atts);
// issue#3433
vAllowed.put("p", no_atts);
vSelfClosingTags = new String[]{"img"};
vNeedClosingTags = new String[]{"a", "b", "strong", "i", "em"};
@@ -429,7 +431,7 @@ public final class HTMLFilter {
ending = "";
}
if (ending == null || ending.length() < 1) {
if (ending == null || ending.isEmpty()) {
if (vTagCounts.containsKey(name)) {
vTagCounts.put(name, vTagCounts.get(name) + 1);
} else {