New submission from Mitar <mmi...@gmail.com>:

Inside text elements both in HTML and SVG white-space is significant and 
introduces differences in how things are rendered. By default in general all 
white-space is collapsed into one space and then this is rendered, adding 
additional text content.

I observed this while working with SVG which can have content like:

<text><tspan>foo</tspan><tspan>bar</tspan></text>

After pretty-printing it with minidom, and white-space collapsing, the 
following is what is input to SVG rendering:

<text> <tspan>foo</tspan> <tspan>bar</tspan> </text>

And space between "foo" and "bar" is now visible and while before it was one 
word to the user, now it is shown as two.

Related issue: https://github.com/mozman/svgwrite/issues/58

I think pretty-printing not add whitespace inside text elements.

----------
components: XML
messages: 346846
nosy: mitar
priority: normal
severity: normal
status: open
title: Minidom should not pretty-print inside text elements
versions: Python 3.6

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

Reply via email to