Commit 9146031b authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web: make sure link has value

parent 83f6ea69
...@@ -35,11 +35,12 @@ class ReplaceRelativeUrlTextDocument(TextDocument, object): ...@@ -35,11 +35,12 @@ class ReplaceRelativeUrlTextDocument(TextDocument, object):
# By conversion, first letter of reference should be upper case # By conversion, first letter of reference should be upper case
# To be more sure of what to replace # To be more sure of what to replace
# erp5-Howto # erp5-Howto
if new_link[0].isupper() or new_link.startswith('erp5-') or new_link.startswith('user-') or \ if new_link:
new_link.startswith('slapos-') or new_link.startswith('vifib-') or new_link.startswith('osoe-') or \ if new_link[0].isupper() or new_link.startswith('erp5-') or new_link.startswith('user-') or \
new_link.startswith('developer-') or new_link.startswith('slapOS'): new_link.startswith('slapos-') or new_link.startswith('vifib-') or new_link.startswith('osoe-') or \
transformed_link_tag = link_tag.replace(link, '%s/%s' % (web_section_url, new_link), 1) new_link.startswith('developer-') or new_link.startswith('slapOS'):
html = html.replace(link_tag, transformed_link_tag) transformed_link_tag = link_tag.replace(link, '%s/%s' % (web_section_url, new_link), 1)
html = html.replace(link_tag, transformed_link_tag)
for img_tag in re.findall(match_img_tag, html): for img_tag in re.findall(match_img_tag, html):
src = re.search(match_img_src, img_tag) src = re.search(match_img_src, img_tag)
......
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