Skip to content

Commit

Permalink
Improved preserve_handlebar_syntax regex
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbe authored and IwanBurg committed Apr 8, 2022
1 parent f4ded0b commit a3491bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion premailer/premailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def transform(self, html=None, pretty_print=True, **kwargs):
# <a href="{{ "<Test>" }}"></a>
if self.preserve_handlebar_syntax:
stripped = re.sub(
r'="{{(.*?)}}"',
r'="([^"]*){{(.*?)}}([^"]*?)"',
lambda match: '="{{' + escape(match.groups()[0]) + '}}"',
stripped,
)
Expand Down

0 comments on commit a3491bf

Please sign in to comment.