From b52a83b9b40f56fb8d873b78e659dfc9af887aab Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Mon, 6 May 2019 01:58:56 +0000 Subject: [PATCH] html_decode() - add support for the following HTML 4 entities: - "lsaquo" and "rsaquo" (angled versions of "lsquo" and "rsquo") - "zwj" and "znnj" (zero-width joiner / non-joiner) --- src/sbbs3/js_global.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c index 30dec125e2..7a58276e6e 100644 --- a/src/sbbs3/js_global.c +++ b/src/sbbs3/js_global.c @@ -2427,8 +2427,9 @@ js_html_decode(JSContext *cx, uintN argc, jsval *arglist) continue; } - if(strcmp(token,"lsquo")==0 || strcmp(token,"rsquo")==0) { - outbuf[j++]='\''; /* single quotation mark */ + if(strcmp(token,"lsquo")==0 || strcmp(token,"rsquo")==0 + || strcmp(token,"lsaquo")==0 || strcmp(token,"rsaquo")==0) { + outbuf[j++]='\''; /* single quotation mark: should lsaquo be converted to backtick (`)? */ continue; } @@ -2442,6 +2443,9 @@ js_html_decode(JSContext *cx, uintN argc, jsval *arglist) continue; } + if(strcmp(token, "zwj") == 0 || strcmp(token, "zwnj") == 0) /* zero-width joiner / non-joiner */ + continue; + /* Unknown character entity, leave intact */ j+=sprintf(outbuf+j,"&%s;",token); -- GitLab