ソースを参照

Fix parsing of leading zeros in named HTML entities (fixes #288)

tags/v0.6.5
Ben Kurtovic 2年前
コミット
f963df7f82
4個のファイルの変更11行の追加3行の削除
  1. +1
    -1
      CHANGELOG
  2. +2
    -1
      docs/changelog.rst
  3. +1
    -1
      src/mwparserfromhell/parser/ctokenizer/tok_parse.c
  4. +7
    -0
      tests/tokenizer/html_entities.mwtest

+ 1
- 1
CHANGELOG ファイルの表示

@@ -1,6 +1,6 @@
v0.7 (unreleased): v0.7 (unreleased):


- ...
- Fixed parsing of leading zeros in named HTML entities. (#288)


v0.6.4 (released February 14, 2022): v0.6.4 (released February 14, 2022):




+ 2
- 1
docs/changelog.rst ファイルの表示

@@ -7,7 +7,8 @@ v0.7
Unreleased Unreleased
(`changes <https://github.com/earwig/mwparserfromhell/compare/v0.6.4...main>`__): (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.6.4...main>`__):


- ...
- Fixed parsing of leading zeros in named HTML entities.
(`#288 <https://github.com/earwig/mwparserfromhell/issues/288>`_)


v0.6.4 v0.6.4
------ ------


+ 1
- 1
src/mwparserfromhell/parser/ctokenizer/tok_parse.c ファイルの表示

@@ -1099,7 +1099,7 @@ Tokenizer_really_parse_entity(Tokenizer *self)
} }
break; break;
} }
if (i == 0 && this == '0') {
if (i == 0 && numeric && this == '0') {
zeroes++; zeroes++;
self->head++; self->head++;
continue; continue;


+ 7
- 0
tests/tokenizer/html_entities.mwtest ファイルの表示

@@ -156,3 +156,10 @@ name: invalid_partial_amp_pound_x_semicolon
label: invalid entities: an ampersand, pound sign, and x label: invalid entities: an ampersand, pound sign, and x
input: "&#x" input: "&#x"
output: [Text(text="&#x")] output: [Text(text="&#x")]

---

name: invalid_zeros_before_named
label: invalid entities: zeros before a valid named entity
input: "&000nbsp;"
output: [Text(text="&000nbsp;")]

読み込み中…
キャンセル
保存