Ver a proveniência

Remove try/except that is impossible to fail inside of.

tags/v0.4
Ben Kurtovic há 10 anos
ascendente
cometimento
457355d4bf
1 ficheiros alterados com 3 adições e 8 eliminações
  1. +3
    -8
      mwparserfromhell/parser/tokenizer.py

+ 3
- 8
mwparserfromhell/parser/tokenizer.py Ver ficheiro

@@ -1119,8 +1119,8 @@ class Tokenizer(object):
return self._pop() return self._pop()


def _handle_table_cell(self, markup, tag, line_context): def _handle_table_cell(self, markup, tag, line_context):
"""Parse as normal syntax unless we hit a style marker, then parse style
as HTML attributes and the remainder as normal syntax."""
"""Parse as normal syntax unless we hit a style marker, then parse
style as HTML attributes and the remainder as normal syntax."""
old_context = self._context old_context = self._context
reset = self._head reset = self._head
reset_for_style, padding, style = False, "", None reset_for_style, padding, style = False, "", None
@@ -1144,12 +1144,7 @@ class Tokenizer(object):
self._head = reset + len(markup) self._head = reset + len(markup)
self._push(contexts.TABLE_OPEN | contexts.TABLE_CELL_OPEN | self._push(contexts.TABLE_OPEN | contexts.TABLE_CELL_OPEN |
line_context) line_context)
try:
padding = self._parse_as_table_style("|")
except BadRoute:
self._head = reset
self._pop()
raise
padding = self._parse_as_table_style("|")
style = self._pop() style = self._pop()
# Don't parse the style separator # Don't parse the style separator
self._head += 1 self._head += 1


Carregando…
Cancelar
Guardar