' is supported in XHTML and HTML5, so at least render it properly when seen in HTML we encounter.
We don't start escaping "'", yet; but if we do, I suggest using ' to ensure compatibility with older w3m versions.
>From b557289dd4309b37a2d9710fa92c3d269ef67228 Mon Sep 17 00:00:00 2001 From: Eric Wong <[email protected]> Date: Sat, 4 May 2019 17:21:48 +0000 Subject: [PATCH] render ' entity ' is supported in XHTML and HTML5, so at least render it properly when seen in HTML we encounter. We don't start escaping "'", yet; but if we do, I suggest using ' to ensure compatibility with older w3m versions. cf. https://bugs.debian.org/927409 --- entity.tab | 2 ++ indep.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/entity.tab b/entity.tab index 130ae2d..c9f9391 100644 --- a/entity.tab +++ b/entity.tab @@ -9,6 +9,8 @@ quot 0x22 QUOT 0x22 nbsp 0xA0 NBSP 0xA0 +apos 0x27 +APOS 0x27 iexcl 0xA1 cent 0xA2 pound 0xA3 diff --git a/indep.c b/indep.c index 5c5de06..386c7e5 100644 --- a/indep.c +++ b/indep.c @@ -462,7 +462,7 @@ getescapechar(char **str) q = p; for (p++; IS_ALNUM(*p); p++) ; q = allocStr(q, p - q); - if (strcasestr("lt gt amp quot nbsp", q) && *p != '=') { + if (strcasestr("lt gt amp quot nbsp apos", q) && *p != '=') { /* a character entity MUST be terminated with ";". However, * there's MANY web pages which uses < , > or something * like them as <, >, etc. Therefore, we treat the most -- EW

