8e3805e3b306 — Marcin Cieślak 3 years ago
Do not create [[Same|Same]] links, kudos to malarz_pl
1 files changed, 5 insertions(+), 1 deletions(-)

M plwiki/chemia/comp.py
M plwiki/chemia/comp.py +5 -1
@@ 103,7 103,11 @@ class Compound:
 		return self.compound.strip()
 
 	def wikilink(self):
-		return "[[%s|%s]]" % (self.title, self.compound.strip())
+		linkpair = (self.title, self.compound.strip())
+		if linkpair[0] == linkpair[1]:
+			return "[[%s]]" % (linkpair[0],)
+		else:
+			return "[[%s|%s]]" % linkpair
 
 
 def extractwiki(site, reallybadfile, compgen, elements):