diff --git a/report_py3o/models/py3o_report.py b/report_py3o/models/py3o_report.py
index 24b1af45..a892dec1 100644
--- a/report_py3o/models/py3o_report.py
+++ b/report_py3o/models/py3o_report.py
@@ -9,6 +9,7 @@ import json
import logging
import os
from contextlib import closing
+from genshi.core import Markup
import pkg_resources
import requests
@@ -64,12 +65,22 @@ def py3o_report_extender(report_xml_id=None):
return fct1
+def format_multiline_value(value):
+ if value:
+ return Markup(unicode(value).replace('<', '<').replace('>', '>').
+ replace('\n', '').
+ replace('\t', ''))
+ return ""
+
+
@py3o_report_extender()
def defautl_extend(report_xml, localcontext):
# add the base64decode function to be able do decode binary fields into
# the template
localcontext['b64decode'] = b64decode
localcontext['report_xml'] = report_xml
+ localcontext['format_multiline_value'] = format_multiline_value
+ localcontext['html_sanitize'] = tools.html2plaintext
class Py3oReport(models.TransientModel):