Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newlines inserted after XML opening tags alter content #9

Open
GoogleCodeExporter opened this issue Mar 28, 2016 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a text element with xml:space="preserve" attribute (used for 
preformatted monospace text labels).
2. Examine output XML and/or import SVG in eg Inkscape

Example code snippet:

label = text('Hello', 10, 10)
label.setAttribute('xml:space', 'preserve')
label.getXML()

What is the expected output? What do you see instead?

Expected XML is:

<text xml:space="preserve" y="10" x="10"  >Hello</text>\n

Actual XML is:

<text xml:space="preserve" y="10" x="10"  >
Hello</text>\n

The linebreak inserted after the opening text tag affects the displayed 
content. In Inkscape, for example, the label appears 6 characters long instead 
of the intended 5.

What version of the product are you using? On what operating system?

PySVG 0.2.1; Linux Mint

Please provide any additional information below.

Resolved by removing the \n from line 63 of src/pysvg/core.py. So, now the 
content of that line reads:

            xml+=' >'

rather than:

            xml+=' >\n'


Original issue reported on code.google.com by Jim.DeV...@gmail.com on 3 Feb 2015 at 6:42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant