From 4b3bb6e83431e9752410ec75a47f1f99ac5fdfde Mon Sep 17 00:00:00 2001 From: dhrname Date: Sat, 1 Dec 2012 23:34:24 +0900 Subject: [PATCH] =?utf8?q?=E3=83=81=E3=82=B1=E3=83=83=E3=83=88=20#30213?= =?utf8?q?=E3=80=8C=E3=83=8F=E3=82=A4=E3=83=91=E3=83=BC=E3=83=AA=E3=83=B3?= =?utf8?q?=E3=82=AF=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E5=85=88=E3=81=AE?= =?utf8?q?=E3=83=99=E3=83=BC=E3=82=B9=E3=81=8C=E5=AE=9F=E9=9A=9B=E3=81=A8?= =?utf8?q?=E7=95=B0=E3=81=AA=E3=82=8B=E3=80=8D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- org/w3c/dom/svg.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org/w3c/dom/svg.js b/org/w3c/dom/svg.js index 9807f42..fbcd196 100644 --- a/org/w3c/dom/svg.js +++ b/org/w3c/dom/svg.js @@ -1011,20 +1011,21 @@ function SVGURIReference() { } else { /*durlが相対URLの場合はdirecoryの名前を消す*/ while (reg.exec(durl)) { - base = base.replace(/\/[^\/]+?$/, ""); + base = base.replace(/\/[^\/]+?(\/[^\/]*?)$/, "$1"); } + base = base.replace(/\/[^\/]+?$/, "/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/ base = base + durl.replace(reg, ""); } if (href.indexOf("#") === 0) { //href属性において#が一番につく場合 uri = base + href; } else if (!uri){ - base = base.replace(/\/[^\/]+?$/, "/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/ + base = base.replace(/\/[^\/]+?$/, "/"); + reg.lastIndex = 0; // execメソッドを使うため while (reg.exec(href)) { - base = base.replace(/\/[^\/]+?$/, ""); + base = base.replace(/\/[^\/]+?(\/[^\/]*?)$/, "$1"); } uri = base + href.replace(reg, ""); } - console.log(uri); show = tar.getAttributeNS("http://www.w3.org/1999/xlink", "show") || "embed"; if (show === "replace") { tar._tar.setAttribute("href", uri); -- 2.11.0