[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
<span id=a> in -halfdump output & jumping to span by id
- From: "Eugene Sharygin" <eush77@xxxxxxxxx>
- Date: Sun, 03 Mar 2019 13:00:23 +0300
- X-ml-name: emacs-w3m
- X-mail-count: 13298
Hi,
I noticed that in -halfdump output <span> elements with ids are not
replaced with corresponding <_id> elements.
For example, for this HTML file:
<li id="foo">foo <span id="span">span</span>
`-halfdump` prints:
<_id id="foo">foo <span id="span">span</span>
Expected output:
<_id id="foo">foo <_id id="span">span</span>
These <_id> tags are used by Emacs-W3m to determine the anchors on the
page. As a result, visiting https://en.wikipedia.org/wiki/W3m#References
(for instance) in Emacs-W3m results in the message "No such anchor:
References" printed in the "*Messages*" buffer because Emacs-W3m does
not recognize the <span id="References"> as an anchor because of the
missing <_id>. (The anchor works correctly in W3m itself.)
Is this a problem with the halfdump or Emacs-W3m's use of it?
I attached a patch that fixes this particular case for me, but it seems
that the issue (if there is one) may be more general and if so, should
be fixed in a more general way.
From 77bde3e8f9433bc8b2cf2cfb03e4b429e45f8e82 Mon Sep 17 00:00:00 2001
From: Eugene Sharygin <eush77@xxxxxxxxx>
Date: Sun, 3 Mar 2019 12:18:28 +0300
Subject: [PATCH] WIP Generate <_id> tag in -halfdump for <span> with id
property
This recognizes id properties in <span> elements and generates <_id>
tags accordingly in the -halfdump output.
---
file.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/file.c b/file.c
index 9b0e947..c594bee 100644
--- a/file.c
+++ b/file.c
@@ -5405,6 +5405,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
HTMLlineproc1("</title>", h_env);
case HTML_HEAD:
case HTML_N_BODY:
+ case HTML_SPAN:
return 1;
default:
/* obuf->prevchar = '\0'; */
--
2.20.1
Eugene