Quote:
Originally Posted by kovidgoyal
That's correct, you have to special case hrefs that are only fragments (start with #)
|
Hah! Got it right by accident, then. Thanks
Digressing to SVG images, now... Any tips on how I might be able to scramble or nullify svg images?
The calibre cover type of usage (<svg>...<image xlink:href="..."></svg) is handled OK already but I'm not sure how to handle
- name.svg images
- name.(x)html pages full of svg drawing commands
I do have a book with an image of type 2. It looks like
Code:
<svg:svg xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 507 681.177" height="96%" id="Penguin_20BW" version="1.1" viewBox="0 0 507 681.177" width="100%" x="0px" xml:space="preserve" y="0px">
<svg:path d="..." fill="..."/>
<svg:path d="..." fill="..."/>
etc etc
</svg:svg>
I nullified this with
Code:
for ele in root.xpath('//*[local-name()="svg"]/*[local-name()="path"]'):
ele.attrib.clear()
but a sample of one doesn't give me any confidence that this is sufficient.