From 71b9468677051a2df4efd8ace39e7743bd53210d Mon Sep 17 00:00:00 2001 From: substantialnoninfringinguser Date: Wed, 13 May 2009 05:20:43 +0100 Subject: [PATCH] [svn] Use URL_ROOT for links Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8074 by julian @ 11/7/2008 9:12 AM --- expo/templatetags/wiki_markup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/expo/templatetags/wiki_markup.py b/expo/templatetags/wiki_markup.py index e2a9d7e..1b08efa 100644 --- a/expo/templatetags/wiki_markup.py +++ b/expo/templatetags/wiki_markup.py @@ -2,6 +2,7 @@ from django import template from django.utils.html import conditional_escape from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe +import settings import re register = template.Library() @@ -54,7 +55,7 @@ def wiki_to_html_short(value, autoescape=None): value = re.sub("'''([^']+)'''", r"\1", value, re.DOTALL) value = re.sub("''([^']+)''", r"\1", value, re.DOTALL) #make cave links - value = re.sub("\[\[\s*cave:([^\s]+)\s*\s*\]\]", r'\1', value, re.DOTALL) + value = re.sub("\[\[\s*cave:([^\s]+)\s*\s*\]\]", r'\1' % settings.URL_ROOT, value, re.DOTALL) #Make lists from lines starting with lists of [stars and hashes] outValue = "" listdepth = []