From 849683ec7087eee13053b919a672a99228133d77 Mon Sep 17 00:00:00 2001 From: souliane Date: Sat, 5 Mar 2016 13:58:02 +0100 Subject: [PATCH] frontends (tools/strings): fixXHTMLLinks skips internal anchors (links starting with "#") fix bug 126 --- frontends/src/tools/strings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/src/tools/strings.py b/frontends/src/tools/strings.py index 632b616d..280f13d0 100644 --- a/frontends/src/tools/strings.py +++ b/frontends/src/tools/strings.py @@ -84,7 +84,7 @@ def fixXHTMLLinks(xhtml): for match in re.finditer(r'', xhtml): tag = match.group(0) url = re.search(r'href="([^"]*)"', tag) - if url: + if url and not url.group(1).startswith("#"): # skip internal anchor if not re.search(r'target="([^"]*)"', tag): # no target subs.append((tag, '