Instantly share code, notes, and snippets.
Last active
December 22, 2024 10:19
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save deton/e4f6870f5e4e6dd85336b05a118124a3 to your computer and use it in GitHub Desktop.
Lynx patch to try to use aria-label attribute instead of HIDDEN_LINK_MARKER in lynx.cfg if <a></a> is empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lynx-hiddenlink-arialabel.patch | |
Try to use "title" or "aria-label" attribute | |
instead of HIDDEN_LINK_MARKER in lynx.cfg | |
for empty <a></a> (like https://note.com/notemag ). | |
* Try to use "title" attribute: | |
HIDDEN_LINK_MARKER: @title | |
* Try to use "title" or "aria-label" attribute: | |
HIDDEN_LINK_MARKER: @aria-label | |
* Use fixed string: | |
HIDDEN_LINK_MARKER:_ | |
diff -urp tmp/lynx2.9.2/WWW/Library/Implementation/dtd_util.c lynx2.9.2/WWW/Library/Implementation/dtd_util.c | |
--- tmp/lynx2.9.2/WWW/Library/Implementation/dtd_util.c 2022-09-30 08:51:16.000000000 +0900 | |
+++ lynx2.9.2/WWW/Library/Implementation/dtd_util.c 2024-12-22 15:54:31.780015147 +0900 | |
@@ -126,6 +126,11 @@ static const attr bgcolor_attr_list[] = | |
{ 0 T(N) } /* Terminate list */ | |
}; | |
+static const attr aria_attr_list[] = { | |
+ { "ARIA-LABEL" T(N) }, | |
+ { 0 T(N) } /* Terminate list */ | |
+}; | |
+ | |
#undef T | |
/* *INDENT-ON* */ | |
@@ -712,6 +717,7 @@ static void dump_source(FILE *output, co | |
ATTR_TYPE(align), | |
ATTR_TYPE(cellalign), | |
ATTR_TYPE(bgcolor), | |
+ ATTR_TYPE(aria), | |
{0, 0} | |
}; | |
AttrType *gt; | |
diff -urp tmp/lynx2.9.2/WWW/Library/Implementation/hdr_HTMLDTD.h lynx2.9.2/WWW/Library/Implementation/hdr_HTMLDTD.h | |
--- tmp/lynx2.9.2/WWW/Library/Implementation/hdr_HTMLDTD.h 2022-09-29 07:26:32.000000000 +0900 | |
+++ lynx2.9.2/WWW/Library/Implementation/hdr_HTMLDTD.h 2024-12-22 15:55:28.452015150 +0900 | |
@@ -1,4 +1,4 @@ | |
-/* $LynxId: hdr_HTMLDTD.h,v 1.25 2022/09/28 22:26:32 tom Exp $ */ | |
+/* $LynxId$ */ | |
#ifndef hdr_HTMLDTD_H | |
#define hdr_HTMLDTD_H 1 | |
@@ -172,31 +172,32 @@ extern "C" { | |
*/ | |
#define HTML_A_ACCESSKEY 0 | |
-#define HTML_A_CHARSET 1 | |
-#define HTML_A_CLASS 2 | |
-#define HTML_A_CLEAR 3 | |
-#define HTML_A_COORDS 4 | |
-#define HTML_A_DIR 5 | |
-#define HTML_A_HREF 6 | |
-#define HTML_A_HREFLANG 7 | |
-#define HTML_A_ID 8 | |
-#define HTML_A_ISMAP 9 | |
-#define HTML_A_LANG 10 | |
-#define HTML_A_MD 11 | |
-#define HTML_A_NAME 12 | |
-#define HTML_A_NOTAB 13 | |
-#define HTML_A_ONBLUR 14 | |
-#define HTML_A_ONFOCUS 15 | |
-#define HTML_A_REL 16 | |
-#define HTML_A_REV 17 | |
-#define HTML_A_SHAPE 18 | |
-#define HTML_A_STYLE 19 | |
-#define HTML_A_TABINDEX 20 | |
-#define HTML_A_TARGET 21 | |
-#define HTML_A_TITLE 22 | |
-#define HTML_A_TYPE 23 | |
-#define HTML_A_URN 24 | |
-#define HTML_A_ATTRIBUTES 25 | |
+#define HTML_A_ARIA_LABEL 1 | |
+#define HTML_A_CHARSET 2 | |
+#define HTML_A_CLASS 3 | |
+#define HTML_A_CLEAR 4 | |
+#define HTML_A_COORDS 5 | |
+#define HTML_A_DIR 6 | |
+#define HTML_A_HREF 7 | |
+#define HTML_A_HREFLANG 8 | |
+#define HTML_A_ID 9 | |
+#define HTML_A_ISMAP 10 | |
+#define HTML_A_LANG 11 | |
+#define HTML_A_MD 12 | |
+#define HTML_A_NAME 13 | |
+#define HTML_A_NOTAB 14 | |
+#define HTML_A_ONBLUR 15 | |
+#define HTML_A_ONFOCUS 16 | |
+#define HTML_A_REL 17 | |
+#define HTML_A_REV 18 | |
+#define HTML_A_SHAPE 19 | |
+#define HTML_A_STYLE 20 | |
+#define HTML_A_TABINDEX 21 | |
+#define HTML_A_TARGET 22 | |
+#define HTML_A_TITLE 23 | |
+#define HTML_A_TYPE 24 | |
+#define HTML_A_URN 25 | |
+#define HTML_A_ATTRIBUTES 26 | |
#define HTML_ADDRESS_CLASS 0 | |
#define HTML_ADDRESS_CLEAR 1 | |
diff -urp tmp/lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.h lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.h | |
--- tmp/lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.h 2022-09-30 09:04:06.000000000 +0900 | |
+++ lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.h 2024-12-22 15:55:10.612015149 +0900 | |
@@ -1,4 +1,4 @@ | |
-/* $LynxId: src0_HTMLDTD.h,v 1.49 2022/09/30 00:04:06 tom Exp $ */ | |
+/* $LynxId$ */ | |
#ifndef src_HTMLDTD_H0 | |
#define src_HTMLDTD_H0 1 | |
@@ -226,6 +226,16 @@ static const AttrType bgcolor_attr_type[ | |
{ 0, 0 }, | |
}; | |
+static const attr aria_attr_list[] = { | |
+ { "ARIA-LABEL" T(N) }, | |
+ { 0 T(N) } /* Terminate list */ | |
+}; | |
+ | |
+static const AttrType aria_attr_type[] = { | |
+ { ATTR_TYPE(aria) }, | |
+ { 0, 0 }, | |
+}; | |
+ | |
/* tables defining attributes per-tag in terms of generic attributes (editable) */ | |
static const attr A_attr_list[] = { | |
@@ -252,6 +262,7 @@ static const attr A_attr_list[] = { | |
}; | |
static const AttrType A_attr_type[] = { | |
+ { ATTR_TYPE(aria) }, | |
{ ATTR_TYPE(core) }, | |
{ ATTR_TYPE(events) }, | |
{ ATTR_TYPE(i18n) }, | |
@@ -1243,6 +1254,7 @@ static const AttrType UL_attr_type[] = { | |
/* attribute lists for the runtime (generated by dtd_util) */ | |
static const attr A_attr[] = { /* A attributes */ | |
{ "ACCESSKEY" T(N) }, | |
+ { "ARIA-LABEL" T(N) }, | |
{ "CHARSET" T(N) }, | |
{ "CLASS" T(c) }, | |
{ "CLEAR" T(N) }, | |
diff -urp tmp/lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.txt lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.txt | |
--- tmp/lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.txt 2022-09-30 09:05:26.000000000 +0900 | |
+++ lynx2.9.2/WWW/Library/Implementation/src0_HTMLDTD.txt 2024-12-22 15:52:03.032015138 +0900 | |
@@ -1,23 +1,26 @@ | |
-60 attr_types | |
+61 attr_types | |
0:align | |
1 attributes: | |
0:0:ALIGN | |
- 1:bgcolor | |
+ 1:aria | |
+ 1 attributes: | |
+ 0:0:ARIA-LABEL | |
+ 2:bgcolor | |
1 attributes: | |
0:0:BGCOLOR | |
- 2:cellalign | |
+ 3:cellalign | |
4 attributes: | |
0:0:ALIGN | |
1:0:CHAR | |
2:0:CHAROFF | |
3:0:VALIGN | |
- 3:core | |
+ 4:core | |
4 attributes: | |
0:4:CLASS | |
1:1:ID | |
2:0:STYLE | |
3:0:TITLE | |
- 4:events | |
+ 5:events | |
10 attributes: | |
0:0:ONCLICK | |
1:0:ONDBLCLICK | |
@@ -29,11 +32,11 @@ | |
7:0:ONMOUSEOUT | |
8:0:ONMOUSEOVER | |
9:0:ONMOUSEUP | |
- 5:i18n | |
+ 6:i18n | |
2 attributes: | |
0:0:DIR | |
1:0:LANG | |
- 6:A | |
+ 7:A | |
19 attributes: | |
0:0:ACCESSKEY | |
1:0:CHARSET | |
@@ -54,11 +57,11 @@ | |
16:0:TARGET | |
17:0:TYPE | |
18:0:URN | |
- 7:ADDRESS | |
+ 8:ADDRESS | |
2 attributes: | |
0:0:CLEAR | |
1:0:NOWRAP | |
- 8:APPLET | |
+ 9:APPLET | |
10 attributes: | |
0:0:ALT | |
1:0:CLEAR | |
@@ -70,7 +73,7 @@ | |
7:1:NAME | |
8:0:VSPACE | |
9:0:WIDTH | |
- 9:AREA | |
+ 10:AREA | |
12 attributes: | |
0:0:ACCESSKEY | |
1:0:ALT | |
@@ -84,16 +87,16 @@ | |
9:0:SHAPE | |
10:0:TABINDEX | |
11:0:TARGET | |
- 10:BASE | |
+ 11:BASE | |
2 attributes: | |
0:2:HREF | |
1:0:TARGET | |
- 11:BGSOUND | |
+ 12:BGSOUND | |
3 attributes: | |
0:0:CLEAR | |
1:0:LOOP | |
2:2:SRC | |
- 12:BODY | |
+ 13:BODY | |
8 attributes: | |
0:0:ALINK | |
1:2:BACKGROUND | |
@@ -103,7 +106,7 @@ | |
5:0:ONUNLOAD | |
6:0:TEXT | |
7:0:VLINK | |
- 13:BODYTEXT | |
+ 14:BODYTEXT | |
8 attributes: | |
0:0:CLEAR | |
1:0:DATA | |
@@ -113,12 +116,12 @@ | |
5:0:TYPE | |
6:0:VALUE | |
7:0:VALUETYPE | |
- 14:BQ | |
+ 15:BQ | |
3 attributes: | |
0:2:CITE | |
1:0:CLEAR | |
2:0:NOWRAP | |
- 15:BUTTON | |
+ 16:BUTTON | |
11 attributes: | |
0:0:ACCESSKEY | |
1:0:CLEAR | |
@@ -131,27 +134,27 @@ | |
8:0:TABINDEX | |
9:0:TYPE | |
10:0:VALUE | |
- 16:CAPTION | |
+ 17:CAPTION | |
2 attributes: | |
0:0:ACCESSKEY | |
1:0:CLEAR | |
- 17:COL | |
+ 18:COL | |
3 attributes: | |
0:0:CLEAR | |
1:0:SPAN | |
2:0:WIDTH | |
- 18:DEL | |
+ 19:DEL | |
2 attributes: | |
0:0:CITE | |
1:0:DATETIME | |
- 19:DIV | |
+ 20:DIV | |
1 attributes: | |
0:0:CLEAR | |
- 20:DL | |
+ 21:DL | |
2 attributes: | |
0:0:CLEAR | |
1:0:COMPACT | |
- 21:EMBED | |
+ 22:EMBED | |
14 attributes: | |
0:0:ALT | |
1:0:BORDER | |
@@ -167,7 +170,7 @@ | |
11:0:UNITS | |
12:0:USEMAP | |
13:0:WIDTH | |
- 22:FIG | |
+ 23:FIG | |
10 attributes: | |
0:0:BORDER | |
1:0:CLEAR | |
@@ -179,14 +182,14 @@ | |
7:2:SRC | |
8:0:UNITS | |
9:0:WIDTH | |
- 23:FONT | |
+ 24:FONT | |
5 attributes: | |
0:0:CLEAR | |
1:0:COLOR | |
2:0:END | |
3:0:FACE | |
4:0:SIZE | |
- 24:FORM | |
+ 25:FORM | |
11 attributes: | |
0:0:ACCEPT | |
1:0:ACCEPT-CHARSET | |
@@ -199,7 +202,7 @@ | |
8:0:SCRIPT | |
9:0:SUBJECT | |
10:0:TARGET | |
- 25:FRAME | |
+ 26:FRAME | |
8 attributes: | |
0:0:FRAMEBORDER | |
1:2:LONGDESC | |
@@ -209,19 +212,19 @@ | |
5:0:NORESIZE | |
6:0:SCROLLING | |
7:2:SRC | |
- 26:FRAMESET | |
+ 27:FRAMESET | |
4 attributes: | |
0:0:COLS | |
1:0:ONLOAD | |
2:0:ONUNLOAD | |
3:0:ROWS | |
- 27:GEN | |
+ 28:GEN | |
1 attributes: | |
0:0:CLEAR | |
- 28:GEN5 | |
+ 29:GEN5 | |
1 attributes: | |
0:0:ROLE | |
- 29:H | |
+ 30:H | |
7 attributes: | |
0:0:CLEAR | |
1:0:DINGBAT | |
@@ -230,7 +233,7 @@ | |
4:0:SEQNUM | |
5:0:SKIP | |
6:2:SRC | |
- 30:HR | |
+ 31:HR | |
6 attributes: | |
0:0:CLEAR | |
1:0:MD | |
@@ -238,7 +241,7 @@ | |
3:0:SIZE | |
4:2:SRC | |
5:0:WIDTH | |
- 31:IFRAME | |
+ 32:IFRAME | |
9 attributes: | |
0:0:FRAMEBORDER | |
1:0:HEIGHT | |
@@ -249,7 +252,7 @@ | |
6:0:SCROLLING | |
7:2:SRC | |
8:0:WIDTH | |
- 32:IMG | |
+ 33:IMG | |
15 attributes: | |
0:0:ALT | |
1:0:BORDER | |
@@ -266,7 +269,7 @@ | |
12:2:USEMAP | |
13:0:VSPACE | |
14:0:WIDTH | |
- 33:INPUT | |
+ 34:INPUT | |
28 attributes: | |
0:0:ACCEPT | |
1:0:ACCEPT-CHARSET | |
@@ -296,23 +299,23 @@ | |
25:0:USEMAP | |
26:0:VALUE | |
27:0:WIDTH | |
- 34:ISINDEX | |
+ 35:ISINDEX | |
3 attributes: | |
0:2:ACTION | |
1:2:HREF | |
2:0:PROMPT | |
- 35:KEYGEN | |
+ 36:KEYGEN | |
2 attributes: | |
0:0:CHALLENGE | |
1:0:NAME | |
- 36:LABEL | |
+ 37:LABEL | |
5 attributes: | |
0:0:ACCESSKEY | |
1:0:CLEAR | |
2:0:FOR | |
3:0:ONBLUR | |
4:0:ONFOCUS | |
- 37:LI | |
+ 38:LI | |
7 attributes: | |
0:0:CLEAR | |
1:0:DINGBAT | |
@@ -321,7 +324,7 @@ | |
4:2:SRC | |
5:0:TYPE | |
6:0:VALUE | |
- 38:LINK | |
+ 39:LINK | |
8 attributes: | |
0:0:CHARSET | |
1:2:HREF | |
@@ -331,31 +334,31 @@ | |
5:0:REV | |
6:0:TARGET | |
7:0:TYPE | |
- 39:MAP | |
+ 40:MAP | |
2 attributes: | |
0:0:CLEAR | |
1:1:NAME | |
- 40:MATH | |
+ 41:MATH | |
2 attributes: | |
0:0:BOX | |
1:0:CLEAR | |
- 41:META | |
+ 42:META | |
5 attributes: | |
0:0:CHARSET | |
1:0:CONTENT | |
2:0:HTTP-EQUIV | |
3:0:NAME | |
4:0:SCHEME | |
- 42:NEXTID | |
+ 43:NEXTID | |
1 attributes: | |
0:0:N | |
- 43:NOTE | |
+ 44:NOTE | |
4 attributes: | |
0:0:CLEAR | |
1:0:MD | |
2:8:ROLE | |
3:2:SRC | |
- 44:OBJECT | |
+ 45:OBJECT | |
19 attributes: | |
0:0:ARCHIVE | |
1:0:BORDER | |
@@ -376,7 +379,7 @@ | |
16:2:USEMAP | |
17:0:VSPACE | |
18:0:WIDTH | |
- 45:OL | |
+ 46:OL | |
6 attributes: | |
0:0:CLEAR | |
1:0:COMPACT | |
@@ -384,7 +387,7 @@ | |
3:0:SEQNUM | |
4:0:START | |
5:0:TYPE | |
- 46:OPTION | |
+ 47:OPTION | |
7 attributes: | |
0:0:CLEAR | |
1:0:DISABLED | |
@@ -393,7 +396,7 @@ | |
4:0:SELECTED | |
5:0:SHAPE | |
6:0:VALUE | |
- 47:OVERLAY | |
+ 48:OVERLAY | |
8 attributes: | |
0:0:HEIGHT | |
1:0:IMAGEMAP | |
@@ -403,11 +406,11 @@ | |
5:0:WIDTH | |
6:0:X | |
7:0:Y | |
- 48:P | |
+ 49:P | |
2 attributes: | |
0:0:CLEAR | |
1:0:NOWRAP | |
- 49:PARAM | |
+ 50:PARAM | |
12 attributes: | |
0:0:ACCEPT | |
1:0:ACCEPT-CHARSET | |
@@ -421,11 +424,11 @@ | |
9:0:VALUE | |
10:0:VALUEREF | |
11:0:VALUETYPE | |
- 50:Q | |
+ 51:Q | |
2 attributes: | |
0:2:CITE | |
1:0:CLEAR | |
- 51:SCRIPT | |
+ 52:SCRIPT | |
10 attributes: | |
0:0:CHARSET | |
1:0:CLEAR | |
@@ -437,7 +440,7 @@ | |
7:0:SCRIPTENGINE | |
8:2:SRC | |
9:0:TYPE | |
- 52:SELECT | |
+ 53:SELECT | |
15 attributes: | |
0:0:CLEAR | |
1:0:DISABLED | |
@@ -454,18 +457,18 @@ | |
12:0:TABINDEX | |
13:0:UNITS | |
14:0:WIDTH | |
- 53:STYLE | |
+ 54:STYLE | |
3 attributes: | |
0:0:MEDIA | |
1:0:NOTATION | |
2:0:TYPE | |
- 54:TAB | |
+ 55:TAB | |
4 attributes: | |
0:0:CLEAR | |
1:0:DP | |
2:0:INDENT | |
3:0:TO | |
- 55:TABLE | |
+ 56:TABLE | |
15 attributes: | |
0:2:BACKGROUND | |
1:0:BORDER | |
@@ -482,7 +485,7 @@ | |
12:0:SUMMARY | |
13:0:UNITS | |
14:0:WIDTH | |
- 56:TD | |
+ 57:TD | |
13 attributes: | |
0:0:ABBR | |
1:0:AXES | |
@@ -497,7 +500,7 @@ | |
10:0:ROWSPAN | |
11:0:SCOPE | |
12:0:WIDTH | |
- 57:TEXTAREA | |
+ 58:TEXTAREA | |
15 attributes: | |
0:0:ACCEPT-CHARSET | |
1:0:ACCESSKEY | |
@@ -514,12 +517,12 @@ | |
12:0:READONLY | |
13:0:ROWS | |
14:0:TABINDEX | |
- 58:TR | |
+ 59:TR | |
3 attributes: | |
0:0:CLEAR | |
1:0:DP | |
2:0:NOWRAP | |
- 59:UL | |
+ 60:UL | |
8 attributes: | |
0:0:CLEAR | |
1:0:COMPACT | |
@@ -532,33 +535,35 @@ | |
128 tags | |
0:A | |
justify | |
- 25 attributes: | |
+ 26 attributes: | |
0:0:ACCESSKEY | |
- 1:0:CHARSET | |
- 2:4:CLASS | |
- 3:0:CLEAR | |
- 4:0:COORDS | |
- 5:0:DIR | |
- 6:2:HREF | |
- 7:0:HREFLANG | |
- 8:1:ID | |
- 9:0:ISMAP | |
- 10:0:LANG | |
- 11:0:MD | |
- 12:1:NAME | |
- 13:0:NOTAB | |
- 14:0:ONBLUR | |
- 15:0:ONFOCUS | |
- 16:0:REL | |
- 17:0:REV | |
- 18:0:SHAPE | |
- 19:0:STYLE | |
- 20:0:TABINDEX | |
- 21:0:TARGET | |
- 22:0:TITLE | |
- 23:0:TYPE | |
- 24:0:URN | |
- 4 attr_types | |
+ 1:0:ARIA-LABEL | |
+ 2:0:CHARSET | |
+ 3:4:CLASS | |
+ 4:0:CLEAR | |
+ 5:0:COORDS | |
+ 6:0:DIR | |
+ 7:2:HREF | |
+ 8:0:HREFLANG | |
+ 9:1:ID | |
+ 10:0:ISMAP | |
+ 11:0:LANG | |
+ 12:0:MD | |
+ 13:1:NAME | |
+ 14:0:NOTAB | |
+ 15:0:ONBLUR | |
+ 16:0:ONFOCUS | |
+ 17:0:REL | |
+ 18:0:REV | |
+ 19:0:SHAPE | |
+ 20:0:STYLE | |
+ 21:0:TABINDEX | |
+ 22:0:TARGET | |
+ 23:0:TITLE | |
+ 24:0:TYPE | |
+ 25:0:URN | |
+ 5 attr_types | |
+ aria | |
core | |
events | |
i18n | |
diff -urp tmp/lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.h lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.h | |
--- tmp/lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.h 2022-09-30 09:03:49.000000000 +0900 | |
+++ lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.h 2024-12-22 15:55:21.116015150 +0900 | |
@@ -1,4 +1,4 @@ | |
-/* $LynxId: src1_HTMLDTD.h,v 1.49 2022/09/30 00:03:49 tom Exp $ */ | |
+/* $LynxId$ */ | |
#ifndef src_HTMLDTD_H1 | |
#define src_HTMLDTD_H1 1 | |
@@ -226,6 +226,16 @@ static const AttrType bgcolor_attr_type[ | |
{ 0, 0 }, | |
}; | |
+static const attr aria_attr_list[] = { | |
+ { "ARIA-LABEL" T(N) }, | |
+ { 0 T(N) } /* Terminate list */ | |
+}; | |
+ | |
+static const AttrType aria_attr_type[] = { | |
+ { ATTR_TYPE(aria) }, | |
+ { 0, 0 }, | |
+}; | |
+ | |
/* tables defining attributes per-tag in terms of generic attributes (editable) */ | |
static const attr A_attr_list[] = { | |
@@ -252,6 +262,7 @@ static const attr A_attr_list[] = { | |
}; | |
static const AttrType A_attr_type[] = { | |
+ { ATTR_TYPE(aria) }, | |
{ ATTR_TYPE(core) }, | |
{ ATTR_TYPE(events) }, | |
{ ATTR_TYPE(i18n) }, | |
@@ -1243,6 +1254,7 @@ static const AttrType UL_attr_type[] = { | |
/* attribute lists for the runtime (generated by dtd_util) */ | |
static const attr A_attr[] = { /* A attributes */ | |
{ "ACCESSKEY" T(N) }, | |
+ { "ARIA-LABEL" T(N) }, | |
{ "CHARSET" T(N) }, | |
{ "CLASS" T(c) }, | |
{ "CLEAR" T(N) }, | |
diff -urp tmp/lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.txt lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.txt | |
--- tmp/lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.txt 2022-09-30 09:04:51.000000000 +0900 | |
+++ lynx2.9.2/WWW/Library/Implementation/src1_HTMLDTD.txt 2024-12-22 15:52:10.412015138 +0900 | |
@@ -1,23 +1,26 @@ | |
-60 attr_types | |
+61 attr_types | |
0:align | |
1 attributes: | |
0:0:ALIGN | |
- 1:bgcolor | |
+ 1:aria | |
+ 1 attributes: | |
+ 0:0:ARIA-LABEL | |
+ 2:bgcolor | |
1 attributes: | |
0:0:BGCOLOR | |
- 2:cellalign | |
+ 3:cellalign | |
4 attributes: | |
0:0:ALIGN | |
1:0:CHAR | |
2:0:CHAROFF | |
3:0:VALIGN | |
- 3:core | |
+ 4:core | |
4 attributes: | |
0:4:CLASS | |
1:1:ID | |
2:0:STYLE | |
3:0:TITLE | |
- 4:events | |
+ 5:events | |
10 attributes: | |
0:0:ONCLICK | |
1:0:ONDBLCLICK | |
@@ -29,11 +32,11 @@ | |
7:0:ONMOUSEOUT | |
8:0:ONMOUSEOVER | |
9:0:ONMOUSEUP | |
- 5:i18n | |
+ 6:i18n | |
2 attributes: | |
0:0:DIR | |
1:0:LANG | |
- 6:A | |
+ 7:A | |
19 attributes: | |
0:0:ACCESSKEY | |
1:0:CHARSET | |
@@ -54,11 +57,11 @@ | |
16:0:TARGET | |
17:0:TYPE | |
18:0:URN | |
- 7:ADDRESS | |
+ 8:ADDRESS | |
2 attributes: | |
0:0:CLEAR | |
1:0:NOWRAP | |
- 8:APPLET | |
+ 9:APPLET | |
10 attributes: | |
0:0:ALT | |
1:0:CLEAR | |
@@ -70,7 +73,7 @@ | |
7:1:NAME | |
8:0:VSPACE | |
9:0:WIDTH | |
- 9:AREA | |
+ 10:AREA | |
12 attributes: | |
0:0:ACCESSKEY | |
1:0:ALT | |
@@ -84,16 +87,16 @@ | |
9:0:SHAPE | |
10:0:TABINDEX | |
11:0:TARGET | |
- 10:BASE | |
+ 11:BASE | |
2 attributes: | |
0:2:HREF | |
1:0:TARGET | |
- 11:BGSOUND | |
+ 12:BGSOUND | |
3 attributes: | |
0:0:CLEAR | |
1:0:LOOP | |
2:2:SRC | |
- 12:BODY | |
+ 13:BODY | |
8 attributes: | |
0:0:ALINK | |
1:2:BACKGROUND | |
@@ -103,7 +106,7 @@ | |
5:0:ONUNLOAD | |
6:0:TEXT | |
7:0:VLINK | |
- 13:BODYTEXT | |
+ 14:BODYTEXT | |
8 attributes: | |
0:0:CLEAR | |
1:0:DATA | |
@@ -113,12 +116,12 @@ | |
5:0:TYPE | |
6:0:VALUE | |
7:0:VALUETYPE | |
- 14:BQ | |
+ 15:BQ | |
3 attributes: | |
0:2:CITE | |
1:0:CLEAR | |
2:0:NOWRAP | |
- 15:BUTTON | |
+ 16:BUTTON | |
11 attributes: | |
0:0:ACCESSKEY | |
1:0:CLEAR | |
@@ -131,27 +134,27 @@ | |
8:0:TABINDEX | |
9:0:TYPE | |
10:0:VALUE | |
- 16:CAPTION | |
+ 17:CAPTION | |
2 attributes: | |
0:0:ACCESSKEY | |
1:0:CLEAR | |
- 17:COL | |
+ 18:COL | |
3 attributes: | |
0:0:CLEAR | |
1:0:SPAN | |
2:0:WIDTH | |
- 18:DEL | |
+ 19:DEL | |
2 attributes: | |
0:0:CITE | |
1:0:DATETIME | |
- 19:DIV | |
+ 20:DIV | |
1 attributes: | |
0:0:CLEAR | |
- 20:DL | |
+ 21:DL | |
2 attributes: | |
0:0:CLEAR | |
1:0:COMPACT | |
- 21:EMBED | |
+ 22:EMBED | |
14 attributes: | |
0:0:ALT | |
1:0:BORDER | |
@@ -167,7 +170,7 @@ | |
11:0:UNITS | |
12:0:USEMAP | |
13:0:WIDTH | |
- 22:FIG | |
+ 23:FIG | |
10 attributes: | |
0:0:BORDER | |
1:0:CLEAR | |
@@ -179,14 +182,14 @@ | |
7:2:SRC | |
8:0:UNITS | |
9:0:WIDTH | |
- 23:FONT | |
+ 24:FONT | |
5 attributes: | |
0:0:CLEAR | |
1:0:COLOR | |
2:0:END | |
3:0:FACE | |
4:0:SIZE | |
- 24:FORM | |
+ 25:FORM | |
11 attributes: | |
0:0:ACCEPT | |
1:0:ACCEPT-CHARSET | |
@@ -199,7 +202,7 @@ | |
8:0:SCRIPT | |
9:0:SUBJECT | |
10:0:TARGET | |
- 25:FRAME | |
+ 26:FRAME | |
8 attributes: | |
0:0:FRAMEBORDER | |
1:2:LONGDESC | |
@@ -209,19 +212,19 @@ | |
5:0:NORESIZE | |
6:0:SCROLLING | |
7:2:SRC | |
- 26:FRAMESET | |
+ 27:FRAMESET | |
4 attributes: | |
0:0:COLS | |
1:0:ONLOAD | |
2:0:ONUNLOAD | |
3:0:ROWS | |
- 27:GEN | |
+ 28:GEN | |
1 attributes: | |
0:0:CLEAR | |
- 28:GEN5 | |
+ 29:GEN5 | |
1 attributes: | |
0:0:ROLE | |
- 29:H | |
+ 30:H | |
7 attributes: | |
0:0:CLEAR | |
1:0:DINGBAT | |
@@ -230,7 +233,7 @@ | |
4:0:SEQNUM | |
5:0:SKIP | |
6:2:SRC | |
- 30:HR | |
+ 31:HR | |
6 attributes: | |
0:0:CLEAR | |
1:0:MD | |
@@ -238,7 +241,7 @@ | |
3:0:SIZE | |
4:2:SRC | |
5:0:WIDTH | |
- 31:IFRAME | |
+ 32:IFRAME | |
9 attributes: | |
0:0:FRAMEBORDER | |
1:0:HEIGHT | |
@@ -249,7 +252,7 @@ | |
6:0:SCROLLING | |
7:2:SRC | |
8:0:WIDTH | |
- 32:IMG | |
+ 33:IMG | |
15 attributes: | |
0:0:ALT | |
1:0:BORDER | |
@@ -266,7 +269,7 @@ | |
12:2:USEMAP | |
13:0:VSPACE | |
14:0:WIDTH | |
- 33:INPUT | |
+ 34:INPUT | |
28 attributes: | |
0:0:ACCEPT | |
1:0:ACCEPT-CHARSET | |
@@ -296,23 +299,23 @@ | |
25:0:USEMAP | |
26:0:VALUE | |
27:0:WIDTH | |
- 34:ISINDEX | |
+ 35:ISINDEX | |
3 attributes: | |
0:2:ACTION | |
1:2:HREF | |
2:0:PROMPT | |
- 35:KEYGEN | |
+ 36:KEYGEN | |
2 attributes: | |
0:0:CHALLENGE | |
1:0:NAME | |
- 36:LABEL | |
+ 37:LABEL | |
5 attributes: | |
0:0:ACCESSKEY | |
1:0:CLEAR | |
2:0:FOR | |
3:0:ONBLUR | |
4:0:ONFOCUS | |
- 37:LI | |
+ 38:LI | |
7 attributes: | |
0:0:CLEAR | |
1:0:DINGBAT | |
@@ -321,7 +324,7 @@ | |
4:2:SRC | |
5:0:TYPE | |
6:0:VALUE | |
- 38:LINK | |
+ 39:LINK | |
8 attributes: | |
0:0:CHARSET | |
1:2:HREF | |
@@ -331,31 +334,31 @@ | |
5:0:REV | |
6:0:TARGET | |
7:0:TYPE | |
- 39:MAP | |
+ 40:MAP | |
2 attributes: | |
0:0:CLEAR | |
1:1:NAME | |
- 40:MATH | |
+ 41:MATH | |
2 attributes: | |
0:0:BOX | |
1:0:CLEAR | |
- 41:META | |
+ 42:META | |
5 attributes: | |
0:0:CHARSET | |
1:0:CONTENT | |
2:0:HTTP-EQUIV | |
3:0:NAME | |
4:0:SCHEME | |
- 42:NEXTID | |
+ 43:NEXTID | |
1 attributes: | |
0:0:N | |
- 43:NOTE | |
+ 44:NOTE | |
4 attributes: | |
0:0:CLEAR | |
1:0:MD | |
2:8:ROLE | |
3:2:SRC | |
- 44:OBJECT | |
+ 45:OBJECT | |
19 attributes: | |
0:0:ARCHIVE | |
1:0:BORDER | |
@@ -376,7 +379,7 @@ | |
16:2:USEMAP | |
17:0:VSPACE | |
18:0:WIDTH | |
- 45:OL | |
+ 46:OL | |
6 attributes: | |
0:0:CLEAR | |
1:0:COMPACT | |
@@ -384,7 +387,7 @@ | |
3:0:SEQNUM | |
4:0:START | |
5:0:TYPE | |
- 46:OPTION | |
+ 47:OPTION | |
7 attributes: | |
0:0:CLEAR | |
1:0:DISABLED | |
@@ -393,7 +396,7 @@ | |
4:0:SELECTED | |
5:0:SHAPE | |
6:0:VALUE | |
- 47:OVERLAY | |
+ 48:OVERLAY | |
8 attributes: | |
0:0:HEIGHT | |
1:0:IMAGEMAP | |
@@ -403,11 +406,11 @@ | |
5:0:WIDTH | |
6:0:X | |
7:0:Y | |
- 48:P | |
+ 49:P | |
2 attributes: | |
0:0:CLEAR | |
1:0:NOWRAP | |
- 49:PARAM | |
+ 50:PARAM | |
12 attributes: | |
0:0:ACCEPT | |
1:0:ACCEPT-CHARSET | |
@@ -421,11 +424,11 @@ | |
9:0:VALUE | |
10:0:VALUEREF | |
11:0:VALUETYPE | |
- 50:Q | |
+ 51:Q | |
2 attributes: | |
0:2:CITE | |
1:0:CLEAR | |
- 51:SCRIPT | |
+ 52:SCRIPT | |
10 attributes: | |
0:0:CHARSET | |
1:0:CLEAR | |
@@ -437,7 +440,7 @@ | |
7:0:SCRIPTENGINE | |
8:2:SRC | |
9:0:TYPE | |
- 52:SELECT | |
+ 53:SELECT | |
15 attributes: | |
0:0:CLEAR | |
1:0:DISABLED | |
@@ -454,18 +457,18 @@ | |
12:0:TABINDEX | |
13:0:UNITS | |
14:0:WIDTH | |
- 53:STYLE | |
+ 54:STYLE | |
3 attributes: | |
0:0:MEDIA | |
1:0:NOTATION | |
2:0:TYPE | |
- 54:TAB | |
+ 55:TAB | |
4 attributes: | |
0:0:CLEAR | |
1:0:DP | |
2:0:INDENT | |
3:0:TO | |
- 55:TABLE | |
+ 56:TABLE | |
15 attributes: | |
0:2:BACKGROUND | |
1:0:BORDER | |
@@ -482,7 +485,7 @@ | |
12:0:SUMMARY | |
13:0:UNITS | |
14:0:WIDTH | |
- 56:TD | |
+ 57:TD | |
13 attributes: | |
0:0:ABBR | |
1:0:AXES | |
@@ -497,7 +500,7 @@ | |
10:0:ROWSPAN | |
11:0:SCOPE | |
12:0:WIDTH | |
- 57:TEXTAREA | |
+ 58:TEXTAREA | |
15 attributes: | |
0:0:ACCEPT-CHARSET | |
1:0:ACCESSKEY | |
@@ -514,12 +517,12 @@ | |
12:0:READONLY | |
13:0:ROWS | |
14:0:TABINDEX | |
- 58:TR | |
+ 59:TR | |
3 attributes: | |
0:0:CLEAR | |
1:0:DP | |
2:0:NOWRAP | |
- 59:UL | |
+ 60:UL | |
8 attributes: | |
0:0:CLEAR | |
1:0:COMPACT | |
@@ -532,33 +535,35 @@ | |
128 tags | |
0:A | |
justify | |
- 25 attributes: | |
+ 26 attributes: | |
0:0:ACCESSKEY | |
- 1:0:CHARSET | |
- 2:4:CLASS | |
- 3:0:CLEAR | |
- 4:0:COORDS | |
- 5:0:DIR | |
- 6:2:HREF | |
- 7:0:HREFLANG | |
- 8:1:ID | |
- 9:0:ISMAP | |
- 10:0:LANG | |
- 11:0:MD | |
- 12:1:NAME | |
- 13:0:NOTAB | |
- 14:0:ONBLUR | |
- 15:0:ONFOCUS | |
- 16:0:REL | |
- 17:0:REV | |
- 18:0:SHAPE | |
- 19:0:STYLE | |
- 20:0:TABINDEX | |
- 21:0:TARGET | |
- 22:0:TITLE | |
- 23:0:TYPE | |
- 24:0:URN | |
- 4 attr_types | |
+ 1:0:ARIA-LABEL | |
+ 2:0:CHARSET | |
+ 3:4:CLASS | |
+ 4:0:CLEAR | |
+ 5:0:COORDS | |
+ 6:0:DIR | |
+ 7:2:HREF | |
+ 8:0:HREFLANG | |
+ 9:1:ID | |
+ 10:0:ISMAP | |
+ 11:0:LANG | |
+ 12:0:MD | |
+ 13:1:NAME | |
+ 14:0:NOTAB | |
+ 15:0:ONBLUR | |
+ 16:0:ONFOCUS | |
+ 17:0:REL | |
+ 18:0:REV | |
+ 19:0:SHAPE | |
+ 20:0:STYLE | |
+ 21:0:TABINDEX | |
+ 22:0:TARGET | |
+ 23:0:TITLE | |
+ 24:0:TYPE | |
+ 25:0:URN | |
+ 5 attr_types | |
+ aria | |
core | |
events | |
i18n | |
diff -urp tmp/lynx2.9.2/src/HTML.c lynx2.9.2/src/HTML.c | |
--- tmp/lynx2.9.2/src/HTML.c 2022-07-23 05:22:13.000000000 +0900 | |
+++ lynx2.9.2/src/HTML.c 2024-12-22 16:20:11.076015238 +0900 | |
@@ -2870,6 +2909,21 @@ static int HTML_start_element(HTStructur | |
FREE(title); | |
} | |
} | |
+#ifdef MARK_HIDDEN_LINKS | |
+ if (title == NULL && non_empty(hidden_link_marker) && | |
+ !strcmp(hidden_link_marker, " @aria-label")) { | |
+ if (present[HTML_A_ARIA_LABEL] && | |
+ non_empty(value[HTML_A_ARIA_LABEL])) { | |
+ StrAllocCopy(title, value[HTML_A_ARIA_LABEL]); | |
+ TRANSLATE_AND_UNESCAPE_ENTITIES(&title, TRUE, FALSE); | |
+ LYTrimHead(title); | |
+ LYTrimTail(title); | |
+ if (*title == '\0') { | |
+ FREE(title); | |
+ } | |
+ } | |
+ } | |
+#endif | |
if (present[HTML_A_ISMAP]) | |
dest_ismap = TRUE; | |
if (present[HTML_A_CHARSET] && | |
@@ -6111,7 +6172,18 @@ static int HTML_end_element(HTStructured | |
#ifdef MARK_HIDDEN_LINKS | |
if (non_empty(hidden_link_marker) && | |
HText_isAnchorBlank(me->text, me->CurrentANum)) { | |
- HText_appendText(me->text, hidden_link_marker); | |
+ if (!strcmp(hidden_link_marker, " @title") | |
+ || !strcmp(hidden_link_marker, " @aria-label")) { | |
+ if (me->CurrentA) { | |
+ HTParentAnchor *dest = NULL; | |
+ dest = HTAnchor_parent(HTAnchor_followLink(me->CurrentA)); | |
+ if (dest != NULL && HTAnchor_title(dest)) { | |
+ HText_appendText(me->text, HTAnchor_title(dest)); | |
+ } | |
+ } | |
+ } else { | |
+ HText_appendText(me->text, hidden_link_marker); | |
+ } | |
} | |
#endif | |
UPDATE_STYLE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment