Browse Source

Cleanup; add a missing test.

tags/v0.4
Ben Kurtovic 9 years ago
parent
commit
913ff590c8
3 changed files with 8 additions and 7 deletions
  1. +0
    -6
      mwparserfromhell/parser/tokenizer.c
  2. +1
    -1
      mwparserfromhell/parser/tokenizer.py
  3. +7
    -0
      tests/tokenizer/tags_wikimarkup.mwtest

+ 0
- 6
mwparserfromhell/parser/tokenizer.c View File

@@ -2783,12 +2783,6 @@ Tokenizer_handle_table_cell(Tokenizer* self, const char *markup,
line_context))
return -1;
padding = Tokenizer_parse_as_table_style(self, '|', 0);
if (BAD_ROUTE) {
trash = Tokenizer_pop(self);
Py_XDECREF(trash);
self->head = reset;
return 0;
}
if (!padding)
return -1;
style = Tokenizer_pop(self);


+ 1
- 1
mwparserfromhell/parser/tokenizer.py View File

@@ -1325,7 +1325,7 @@ class Tokenizer(object):
elif this in ("\n", ":") and self._context & contexts.DL_TERM:
self._handle_dl_term()
if this == "\n":
# kill potential table contexts
# Kill potential table contexts
self._context &= ~contexts.TABLE_CELL_LINE_CONTEXTS
# Start of table parsing
elif this == "{" and next == "|" and (self._read(-1) in ("\n", self.START) or


+ 7
- 0
tests/tokenizer/tags_wikimarkup.mwtest View File

@@ -447,6 +447,13 @@ output: [TagOpenOpen(wiki_markup=":"), Text(text="dd"), TagCloseSelfclose(), Tag

---

name: dt_dd_mix4
label: another example of correct dt/dd usage, with a trigger for a specific parse route
input: ";foo]:bar"
output: [TagOpenOpen(wiki_markup=";"), Text(text="dt"), TagCloseSelfclose(), Text(text="foo]"), TagOpenOpen(wiki_markup=":"), Text(text="dd"), TagCloseSelfclose(), Text(text="bar")]

---

name: ul_ol_dt_dd_mix
label: an assortment of uls, ols, dds, and dts
input: ";:#*foo\n:#*;foo\n#*;:foo\n*;:#foo"


Loading…
Cancel
Save