From 98f6739b473be47161199189b2c21203f93d0b6b Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 7 May 2022 21:01:41 +0200 Subject: MarkdownConverter: Permit abbr, acronym tags. Change-Id: I5669fa48e0ff1521838ae62e2439a5feb6b1445b --- .../java/eu/mulk/mulkcms2/common/markdown/MarkdownConverter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu') 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(); -- cgit v1.2.3