[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Links not working
- From: Hideyuki SHIRAI (白井秀行) <shirai@xxxxxxxxxxx>
- Date: Wed, 26 Jan 2011 22:49:53 +0900 (JST)
- X-ml-name: emacs-w3m
- X-mail-count: 11498
- References: <20524da71002201158u27636d76w5d9a4008850052a7@xxxxxxxxxxxxxx> <b4m4olajfh7.fsf@xxxxxxx> <b4m8waldguw.fsf@xxxxxxx>
白井です。
From: Katsumi Yamaoka <yamaoka@xxxxxxx> さん曰く
Subject: [emacs-w3m:11153] Re: Links not working
Message-ID: <b4m8waldguw.fsf@xxxxxxx>
Date: Mon, 22 Feb 2010 13:39:03 +0900
(defun w3m-rendering-half-dump (charset)
....
(goto-char (point-min))
(let (start tag name)
(while (re-search-forward "<\\([^\t\n\r >]+\\)\
\[\t\n\r ]+\\(?:[^\t\n\r >]+[\t\n\r ]+\\)*id=\\(\"[^\"]+\"\\)"
nil t)
(setq start (match-beginning 0)
tag (regexp-quote (match-string 1))
name (match-string 2))
(when (looking-at (concat "[^>]*>[^<]+</" tag ">"))
(save-restriction
(narrow-to-region (goto-char start) (match-end 0))
(insert "<a name=" name ">")
(goto-char (point-max))
(insert "</a>")))))
でエラーするパターンを見つけてしまいました。html 内に↓なのが書
いてあって
<script type="text/javascript">
//<![CDATA[
var ID="1234567";
var AD=0;
var FRAME=0;
//]]>
</script>
tag => "![CDATA["
となるので、
(looking-at (concat "[^>]*>[^<]+</" tag ">"))
=> entered--Lisp error: (invalid-regexp "Unmatched [ or [^")
となります。when 全体を condition-case で囲っちゃうか、
(setq tag (regexp-quote (match-string 1))) だと思いますが、よろ
しくお願いします。
--
白井秀行 (mailto:shirai@xxxxxxxxxxx)