Skip to content

Commit

Permalink
Merge pull request #3 from torico-tokyo/feature/svg
Browse files Browse the repository at this point in the history
Feature/svg
  • Loading branch information
ytyng authored Sep 3, 2024
2 parents a97c062 + b7049ea commit e205d2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion epub_extractor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# coding: utf-8

__author__ = 'torico'
__version__ = '0.4.4'
__version__ = '0.4.5'
__license__ = 'BSD'
6 changes: 4 additions & 2 deletions epub_extractor/epub_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ def page_xhtml_etree(self) -> ElementTree:

@cached_property
def image_element(self) -> Element:

if self.item_element.attrib.get('properties') == 'svg':
properties = self.item_element.attrib.get('properties', None)
# 'svg ' という文字列のケースがあるので strip して対応する。
# SVG, svg+xxx などのケースがあるようなら見つけ次第対応する。
if properties and properties.strip() == 'svg':
# SVGラッピング 日本のコミックEPUBでよくある形式
svg = self.page_xhtml_etree.find(
'.//{http://www.w3.org/2000/svg}svg'
Expand Down

0 comments on commit e205d2a

Please sign in to comment.