diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py
index 2e47a205e..6b1f5b114 100755
--- a/sapl/relatorios/views.py
+++ b/sapl/relatorios/views.py
@@ -1225,8 +1225,23 @@ def get_pauta_sessao(sessao, casa):
expedientes = []
for e in expediente:
tipo = e.tipo
- conteudo = re.sub(
- ' ', ' ', strip_tags(e.conteudo.replace('
', '\n')))
+ conteudo = e.conteudo
+ if not is_empty(conteudo):
+ # unescape HTML codes
+ # https://github.com/interlegis/sapl/issues/1046
+ conteudo = re.sub('style=".*?"', '', conteudo)
+ conteudo = re.sub('class=".*?"', '', conteudo)
+ conteudo = re.sub('align=".*?"', '', conteudo) # OSTicket Ticket #796450
+ conteudo = re.sub('
', '
', conteudo)
+ conteudo = re.sub('
', '
', conteudo) # OSTicket Ticket #796450
+ conteudo = html.unescape(conteudo)
+
+ # escape special character '&'
+ # https://github.com/interlegis/sapl/issues/1009
+ conteudo = conteudo.replace('&', '&')
+
+ # https://github.com/interlegis/sapl/issues/2386
+ conteudo = remove_html_comments(conteudo)
ex = {'tipo': tipo, 'conteudo': conteudo}
expedientes.append(ex)