Skip to content

Don't add group with no (valid) elements#7

Open
vitchyr wants to merge 3 commits into
cjlano:masterfrom
vitchyr:master
Open

Don't add group with no (valid) elements#7
vitchyr wants to merge 3 commits into
cjlano:masterfrom
vitchyr:master

Conversation

@vitchyr

@vitchyr vitchyr commented Jun 26, 2015

Copy link
Copy Markdown

From the commit message:

Do the recursive step first. Then check if the child element has anything. It may be the case that the child element has no valid children, in which case don't both appending this group.

I ran into this problem after I tried running svg_test.py on a pdf generated from pdf2svg. It created a bunch of tags like the following:

<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">                                  
    <use xlink:href="#glyph1-8" x="554.6093" y="813.5435"/>                       
</g>

Although the invalid tag is successfully ignored in the recursive call to append() via the elt_class check, this isn't handled by the parent group. I think the only problem occurs when a group element only has invalid children, so hence the added check. I'm not familiar with how this might affect other code, but it doesn't seem to break anything else in the code.

maiqbal11 and others added 3 commits June 26, 2015 16:29
Do the recursive step first. Then check if the child element has
anything. It may be the case that the child element has no valid
children, in which case don't both appending this group.
Do the recursive step first. Then check if the child element has
anything. It may be the case that the child element has no valid
children, in which case don't both appending this group.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants