org.apache.poi
diff --git a/src/main/java/sirius/web/templates/pdf/TagliatellePDFContentHandler.java b/src/main/java/sirius/web/templates/pdf/TagliatellePDFContentHandler.java
index 55059c8ad..c1619bc89 100644
--- a/src/main/java/sirius/web/templates/pdf/TagliatellePDFContentHandler.java
+++ b/src/main/java/sirius/web/templates/pdf/TagliatellePDFContentHandler.java
@@ -8,6 +8,9 @@
package sirius.web.templates.pdf;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Entities;
import org.xhtmlrenderer.pdf.ITextRenderer;
import sirius.kernel.di.std.Part;
import sirius.kernel.di.std.Register;
@@ -53,7 +56,7 @@ public boolean generate(Generator generator, OutputStream out) throws Exception
ITextRenderer renderer = new ITextRenderer();
renderer.getSharedContext()
.setReplacedElementFactory(new ImageReplacedElementFactory(renderer.getOutputDevice()));
- renderer.setDocumentFromString(content);
+ renderer.setDocumentFromString(cleanHtml(content));
renderer.layout();
renderer.createPDF(out);
out.flush();
@@ -61,6 +64,30 @@ public boolean generate(Generator generator, OutputStream out) throws Exception
return true;
}
+ /**
+ * Cleans the given HTML content for use as input to the PDF generator.
+ *
+ * This is done by first generally removing all {@code