From d5add243c7204524f7258c2b32e504b8e42d716b Mon Sep 17 00:00:00 2001 From: stefanp Date: Wed, 4 Dec 2002 09:35:09 +0000 Subject: [PATCH] render_action: fixed problem with regex parsing of links with anchors --- DocApplication/functions.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/DocApplication/functions.js b/DocApplication/functions.js index 88908e71..aa586d6e 100644 --- a/DocApplication/functions.js +++ b/DocApplication/functions.js @@ -55,12 +55,13 @@ function getPage (obj, action, backPath) { var str = res.popStringBuffer (); // get the baseURI out of the url and replace // it with the given relative prefix - var reg = new RegExp ("href=\"" + this.href ("") + "([^\"]+)\""); + // (keep anchors in regex!) + var reg = new RegExp ("href=\"" + this.href ("") + "([^\"#]+)([^\"]*)\""); reg.global = true; - str = str.replace (reg, "href=\"" + backPath + "$1.html\""); - var reg = new RegExp ("src=\"" + this.href ("") + "([^\"]+)\""); + str = str.replace (reg, "href=\"" + backPath + "$1.html$2\""); + var reg = new RegExp ("src=\"" + this.href ("") + "([^\"#]+)([^\"]*)\""); reg.global = true; - str = str.replace (reg, "src=\"" + backPath + "$1.html\""); + str = str.replace (reg, "src=\"" + backPath + "$1.html$2\""); // shorten links, so that function files can move up one directory // in the hierarchy var reg = new RegExp ("(prototype_[^/]+/[^/]+)/main.html");