Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entities: support ' entity #122

Merged
merged 1 commit into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions entity.tab
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ amp 0x26
AMP 0x26
quot 0x22
QUOT 0x22
apos 0x27
APOS 0x27
nbsp 0xA0
NBSP 0xA0
iexcl 0xA1
Expand Down
6 changes: 3 additions & 3 deletions indep.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ unsigned char QUOTE_MAP[0x100] = {
/* DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US */
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
/* SPC ! " # $ % & ' ( ) * + , - . / */
24, 72, 76, 40, 8, 40, 41, 72, 72, 72, 72, 40, 72, 8, 0, 64,
24, 72, 76, 40, 8, 40, 41, 77, 72, 72, 72, 40, 72, 8, 0, 64,
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 72, 74, 72, 75, 40,
/* @ A B C D E F G H I J K L M N O */
Expand Down Expand Up @@ -47,7 +47,7 @@ char *HTML_QUOTE_MAP[] = {
"&lt;",
"&gt;",
"&quot;",
NULL,
"&apos;",
NULL,
NULL,
};
Expand Down Expand Up @@ -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 apos nbsp", q) && *p != '=') {
/* a character entity MUST be terminated with ";". However,
* there's MANY web pages which uses &lt , &gt or something
* like them as &lt;, &gt;, etc. Therefore, we treat the most
Expand Down
2 changes: 1 addition & 1 deletion indep.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct growbuf {

extern unsigned char QUOTE_MAP[];
extern char *HTML_QUOTE_MAP[];
#define HTML_QUOTE_MASK 0x07 /* &, <, >, " */
#define HTML_QUOTE_MASK 0x07 /* &, <, >, ", ' */
#define SHELL_UNSAFE_MASK 0x08 /* [^A-Za-z0-9_./:\200-\377] */
#define URL_QUOTE_MASK 0x10 /* [\0- \177-\377] */
#define FILE_QUOTE_MASK 0x30 /* [\0- #%&+:?\177-\377] */
Expand Down