-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transforms to text/xxx should deal with bytes and text. Output is text
- Loading branch information
Showing
4 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
from Products.CMFPlone.utils import safe_unicode | ||
from Products.PortalTransforms.interfaces import ITransform | ||
from zope.interface import implementer | ||
|
||
|
@@ -25,6 +26,7 @@ def addRegex(self, pat, repl): | |
self.regexes.append((r, repl)) | ||
|
||
def convert(self, orig, data, **kwargs): | ||
orig = safe_unicode(orig) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
petschki
Member
|
||
for r, repl in self.regexes: | ||
orig = r.sub(repl, orig) | ||
data.setData(orig) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It seems this has to be: