[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: Links not working



白井です。

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)