mefistotelis <mefistote...@gmail.com> added the comment:

Patch attached.

I was thinking about one for() instead, but didn't wanted to introduce too 
large changes..

Let me know if you would prefer something like:

    for i in (9,10,13,):
        if chr(i) not in text: continue
        text = text.replace(chr(i), "&#{:02d};".format(i))

That would also make it easy to extend for other chars, ie. if we'd like  the 
parser to be always able to re-read the XML we've created. Currently, placing 
control chars in attributes will prevent that. But I'm getting out of scope of 
this issue now.

----------
keywords: +patch
Added file: 
https://bugs.python.org/file48885/0001-bpo-39011-Preserve-line-endings-within-attributes.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39011>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to