From e7da5adc6cd8056da3badb754339923743e60189 Mon Sep 17 00:00:00 2001 From: KeyserSosa Date: Fri, 13 Feb 2009 11:58:05 -0800 Subject: [PATCH] fix parent links --- r2/r2/lib/template_helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/r2/r2/lib/template_helpers.py b/r2/r2/lib/template_helpers.py index 09b0d019f..70919a7ca 100644 --- a/r2/r2/lib/template_helpers.py +++ b/r2/r2/lib/template_helpers.py @@ -232,6 +232,10 @@ def add_sr(path, sr_path = True, nocname=False, force_hostname = False): * sr_path: if a cname is not used for the domain, updates the path to include c.site.path. """ + # don't do anything if it is just an anchor + if path.startswith('#'): + return path + u = UrlParser(path) if sr_path and (nocname or not c.cname): u.path_add_subreddit(c.site)