Open GoogleCodeExporter opened 9 years ago
This is easily fixed by preformatting the html code:
After you open and read the html code into a variable like this
with open(infile,'r') as f:
text = f.read(-1)
you add this (you will need "import re"):
text = re.sub('&','@amp',text)
Now in the handle_data method in the Class HTML2FPDF(HTMLParser) you add this
line at the very beginning of the method:
txt = re.sub('@amp','&',txt)
And the problem is solved. The problem is caused by the entityref method not
being implemented
Original comment by fredpett...@gmail.com
on 16 Jul 2013 at 10:59
Original issue reported on code.google.com by
marc.pfi...@gmail.com
on 19 Feb 2013 at 9:24