frontends (tools/strings): fixXHTMLLinks skips internal anchors (links starting with "#")
fix bug 126
This commit is contained in:
parent
f71e2451d7
commit
849683ec70
1 changed files with 1 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ def fixXHTMLLinks(xhtml):
|
|||
for match in re.finditer(r'<a( \w+="[^"]*")* ?/?>', 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, '<a target="_blank"%s' % tag[2:]))
|
||||
if not re.match(r"^\w+://", url.group(1)): # no scheme
|
||||
|
|
|
|||
Loading…
Reference in a new issue