changeset 1886:7055054118f4

GUI converter: fixed conversion of relative wiki links
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 16 Mar 2007 12:53:17 +0100
parents 9e4aeac3abff
children 447c183a41bc
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Wed Mar 14 11:01:12 2007 +0100
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Fri Mar 16 12:53:17 2007 +0100
@@ -1147,13 +1147,13 @@
                 if text == pagename:
                     self.text.append(wikiutil.pagelinkmarkup(pagename))
                 # relative link /SubPage
-                elif href.endswith(text):
+                elif text.startswith('/') and href.endswith(text):
                     if pagename.startswith(self.pagename): # is this a subpage of us?
                         self.text.append(wikiutil.pagelinkmarkup(pagename[len(self.pagename):]))
                     else:
                         self.text.append(wikiutil.pagelinkmarkup(pagename))
                 # relative link ../
-                elif href.endswith(text.lstrip("..").lstrip("/")):
+                elif text.startswith('../') and href.endswith(text[3:]):
                     self.text.append(wikiutil.pagelinkmarkup(text))
                 # labeled link
                 else: