fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix impovement for IT #3356 - workaround rare problem
[librarian.git]
/
librarian
/
epub.py
diff --git
a/librarian/epub.py
b/librarian/epub.py
index
b079d65
..
8dba5ac
100644
(file)
--- a/
librarian/epub.py
+++ b/
librarian/epub.py
@@
-47,9
+47,8
@@
def set_hyph_language(source_tree):
pass
def hyphenate_and_fix_conjunctions(source_tree, hyph):
pass
def hyphenate_and_fix_conjunctions(source_tree, hyph):
- """ hyphenate only powiesc, opowiadanie and wywiad tag"""
if hyph is not None:
if hyph is not None:
- texts = etree.XPath('/
/*[self::powiesc|self::opowiadanie|self::wywiad
]//text()')(source_tree)
+ texts = etree.XPath('/
utwor/*[2
]//text()')(source_tree)
for t in texts:
parent = t.getparent()
newt = ''
for t in texts:
parent = t.getparent()
newt = ''
@@
-285,7
+284,10
@@
class TOC(object):
nav_label = nav_map.makeelement(NCXNS('navLabel'))
text = nav_map.makeelement(NCXNS('text'))
nav_label = nav_map.makeelement(NCXNS('navLabel'))
text = nav_map.makeelement(NCXNS('text'))
- text.text = re.sub(r'\n', ' ', child.name)
+ if child.name is not None:
+ text.text = re.sub(r'\n', ' ', child.name)
+ else:
+ text.text = child.name
nav_label.append(text)
nav_point.append(nav_label)
nav_label.append(text)
nav_point.append(nav_label)