Commit 2c686c75 authored by Nicolas Delaby's avatar Nicolas Delaby

Self-Close <base /> element

replace only first occurrence of <head>



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34149 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c9db3aee
...@@ -1138,8 +1138,8 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, S ...@@ -1138,8 +1138,8 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, S
# if base is defined yet. # if base is defined yet.
html = str(html) html = str(html)
if not html.find('<base') >= 0: if not html.find('<base') >= 0:
base = '<base href="%s">' % self.getContentBaseURL() base = '<base href="%s"/>' % self.getContentBaseURL()
html = html.replace('<head>', '<head>%s' % base) html = html.replace('<head>', '<head>%s' % base, 1)
self.setConversion(html, mime='text/html', format='base-html') self.setConversion(html, mime='text/html', format='base-html')
return html return html
......
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