summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-05-07 21:01:41 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-05-07 21:01:41 +0200
commit98f6739b473be47161199189b2c21203f93d0b6b (patch)
treec60ba5920fa524296e4653716904b1ae1788d103 /src
parent51025649ffce0fd68b794d28a1b073750f517a4d (diff)
MarkdownConverter: Permit abbr, acronym tags.
Change-Id: I5669fa48e0ff1521838ae62e2439a5feb6b1445b
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java b/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java
index 013a5dd..859fd71 100644
--- a/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java
+++ b/src/main/java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java
@@ -49,7 +49,12 @@ public class MarkdownConverter {
public String htmlify(String markdown) {
var parsedDocument = parser.parse(markdown);
var uncleanHtml = renderer.render(parsedDocument);
- var cleaner = new Cleaner(Safelist.relaxed().addTags("abbr", "acronym"));
+ var cleaner =
+ new Cleaner(
+ Safelist.relaxed()
+ .addTags("abbr", "acronym")
+ .addAttributes("abbr", "title")
+ .addAttributes("acronym", "title"));
var cleanedDocument = cleaner.clean(Jsoup.parseBodyFragment(uncleanHtml));
cleanedDocument.select("table").addClass("pure-table").addClass("pure-table-horizontal");
return cleanedDocument.body().html();