From cc6d2b299c11b9a9b75ca8bec6f6b24660a79a2f Mon Sep 17 00:00:00 2001 From: drry Date: Wed, 19 Nov 2008 19:42:02 +0000 Subject: * 大文字に対応しました。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24379 d0d07461-0603-4401-acd4-de1884942a52 --- auto_detect_link.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'auto_detect_link.js') diff --git a/auto_detect_link.js b/auto_detect_link.js index d273a3b..136878e 100644 --- a/auto_detect_link.js +++ b/auto_detect_link.js @@ -391,15 +391,16 @@ let links = getAllLinks(window.content); // rel="prev|next" - if (1) { - let relValue = next ? /next/ : /prev/; - let link = find(links, function (link) ((typeof link.rel == 'string') && link.rel.match(relValue))); + { + let relValue = next ? /(?:^|[ \t\r\n])next(?:[ \t\n\r]|$)/ + : /(?:^|[ \t\r\n])prev(?:[ \t\n\r]|$)/; + let link = find(links, function (link) ((typeof link.rel == 'string') && relValue.test(link.rel.toLowerCase()))); if (link) return link; } // keywords - if (1) { + { let link; if (patterns.some(function (pattern) { link = find(links, function (link) match(pattern, link)); -- cgit v1.2.3