Commit 9a308695 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Better support for base URL in TextDocument.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13682 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d8878e6c
......@@ -151,3 +151,15 @@ class TextDocument(Document, TextContent):
def __call__(self):
_setCacheHeaders(self, {})
return Document.__call__(self)
security.declareProtected(Permissions.AccessContentsInformation, 'getContentBaseURL')
def getContentBaseURL(self):
"""
Returns the content base URL based on the actual content
(in HTML)
"""
html = self.asHTML()
base_list = re.findall(self.base_parser, str(html))
if base_list:
return base_list[0]
return Document.getContentBaseURL(self)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment