Skip to content

Commit 0c67848

Browse files
committed
Don't reject entity names containing digits
*Problem* Since 0d94837, the digit in entity names like `¹` is ignored by the decoder; e.g., `⊃1` *Solution* Include decimal digits in the set of allowed characters for non-numeric entities
1 parent 6a27eb9 commit 0c67848

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/Entities.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,13 @@ int Entities::decode() {
8888
isNumeric = true;
8989
allowedChars << L"x" << scDigits;
9090
} else
91-
allowedChars << scLetters << L";";
91+
allowedChars << scLetters << scDigits;
9292
} else if (i == 2) {
93-
if (isNumeric) {
94-
if (target[firstPos + 1] == L'x') {
95-
isHex = true;
96-
allowedChars << scHexLetters << L";";
97-
} else
98-
allowedChars << scDigits << L";";
93+
if (isNumeric && target[firstPos + 1] == L'x') {
94+
isHex = true;
95+
allowedChars << scHexLetters;
9996
}
97+
allowedChars << L";";
10098
}
10199

102100
if (allowedChars.str().find(target[firstPos + i]) == std::wstring::npos) {

0 commit comments

Comments
 (0)