From 2b03edc6126c6d78c151c1b2d3b27d32ba287f51 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Wed, 3 Jan 2024 19:10:44 -0300 Subject: [PATCH] Escape the text used in the observations --- pytrustnfe/nfe/danfe.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pytrustnfe/nfe/danfe.py b/pytrustnfe/nfe/danfe.py index 3d5d251b..93b89ba8 100644 --- a/pytrustnfe/nfe/danfe.py +++ b/pytrustnfe/nfe/danfe.py @@ -7,6 +7,7 @@ from io import BytesIO from textwrap import wrap import math +from html import escape from decimal import Decimal from reportlab.lib import utils @@ -1051,7 +1052,7 @@ def adicionais(self, oXML=None, tamanho_diminuir=0): observacoes = tagtext(oNode=el_infAdic, cTag="infCpl") if fisco: observacoes = fisco + " " + observacoes - P = Paragraph(observacoes, styles["Normal"]) + P = Paragraph(escape(observacoes), styles["Normal"]) w, h = P.wrap(128 * mm, 32 * mm) altura = (self.height - self.nlin - 5) * mm P.drawOn(self.canvas, (self.nLeft + 1) * mm, altura - h) diff --git a/setup.py b/setup.py index 911c7281..d591be8b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages -VERSION = "2.0.1" +VERSION = "2.0.2" setup(