Skip to content

Commit

Permalink
Some minor improvements in the _replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Sofia Margariti committed Jan 24, 2018
1 parent a04c819 commit a28cf93
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openformats/formats/indesign.py
Expand Up @@ -125,16 +125,16 @@ def _replace(self, match):
replace strings with their template replacement and appends new strings
to `self.stringset`.
"""
opening_tag = match.group(1)
string = match.group(2).decode('utf-8')
closing_tag = match.group(3)
opening_tag, string, closing_tag = match.groups()
string = string.decode('utf-8')

if self._can_skip_content(string):
return opening_tag + string + closing_tag
return match.group()
order = next(self.order)
string_object = OpenString(str(order), string, order=order)
self.stringset.append(string_object)
return opening_tag + string_object.template_replacement + closing_tag
return "".join((opening_tag, string_object.template_replacement,
closing_tag))

""" Compile Methods """

Expand Down

0 comments on commit a28cf93

Please sign in to comment.