newt += builder.hyphenator.inserted(w, u'\u00AD')
text = newt
- text = re.sub(r'(?<=\s\w)\s+', u'\u00A0', text)
+ if builder.orphans:
+ text = re.sub(r'(?<=\s\w)\s+', u'\u00A0', text)
return text
if self.SECTION_PRECEDENCE:
assert isinstance(self.getparent(), (Master, DlugiCytat, PoezjaCyt, Footnote)), \
'Header {} inside a <{}> instead of a master.'.format(
- etree.tostring(self), self.getparent().tag)
+ etree.tostring(self, encoding='unicode'), self.getparent().tag)
for c in self:
if isinstance(c, WLElement):