mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
fix #113
This commit is contained in:
@@ -24,8 +24,9 @@ public class FeedUtils {
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public static String handleContent(String content) {
|
||||
public static String handleContent(String content, String baseUri) {
|
||||
if (StringUtils.isNotBlank(content)) {
|
||||
baseUri = StringUtils.trimToEmpty(baseUri);
|
||||
Whitelist whitelist = Whitelist.relaxed();
|
||||
whitelist.addEnforcedAttribute("a", "target", "_blank");
|
||||
|
||||
@@ -33,8 +34,9 @@ public class FeedUtils {
|
||||
whitelist.addAttributes("iframe", "src", "height", "width",
|
||||
"allowfullscreen", "frameborder");
|
||||
|
||||
content = Jsoup.clean(content, "", whitelist,
|
||||
new OutputSettings().escapeMode(EscapeMode.base));
|
||||
content = Jsoup.clean(content, baseUri, whitelist,
|
||||
new OutputSettings().escapeMode(EscapeMode.base)
|
||||
.prettyPrint(false));
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user