Improving test and bug fixing in TextElement.get_text()
What does the merge request do?
@olafur found that my previous MR (!584 (merged)) about the get_text()
function did some problems to Gcodetools (#inkscape#4779). He wrote some tests (!619 (closed)) which were incorporated and adapted in this MR.
closes #inkscape#4779 closes !619 (closed)
Implementation notes
- Removing the tail of the main
text
element and removing thestrip
from the tests - The tags
title
anddesc
were completely ignored as they are not displayed in inkscape. The problem was that their tail were also ignored. Now we iterate over all the children of the text element, get only the text fromtext
andtspan
tags and get the tail from every child - Tests from @olafur were incorporated but adapted to not get the text of
text
and `tspan
Summary for release notes
Fixing get_text
for text
elements
Checklist
-
Add unit tests (if applicable) -
Changes to inkex/
are well documented -
Clean merge request history