[reportlab-users] Paragraph text with &
Juha Tuomala
Juha.Tuomala at iki.fi
Fri Feb 2 08:10:30 EST 2007
On Friday 02 February 2007 14:42, Juha Ruotsalainen wrote:
> I'm creating a paragraph this way:
> para = XPreformatted( contentText, style ),
>
> where the contentText contains "Jim, Joe & Jill"
>
> Now Paragraph's _setup-method dies on that ampersand. To be precise,
> _parser.parse(text,style) is the quitter. It complains about that
> ampersand being at the beginning of a line. I inserted some debug
> print into the parse method of Paraparser, and I found out that it
> splits my text into components, and one of those components is a line
> containing, at the beginning of the line, only that ampersand.
Add:
text = text.replace('&', '&')
before your Paragraph and it should work.
Tuju
--
Ajatteleva ihminen tarvitsee unta.
More information about the reportlab-users
mailing list