Ver a proveniência

Fix tokenizer so we don't destroy our textbuf writing an empty stack

* Also fix a bug in Argument
tags/v0.1
Ben Kurtovic há 11 anos
ascendente
cometimento
353122105d
2 ficheiros alterados com 3 adições e 2 eliminações
  1. +1
    -1
      mwparserfromhell/nodes/argument.py
  2. +2
    -1
      mwparserfromhell/parser/tokenizer.py

+ 1
- 1
mwparserfromhell/nodes/argument.py Ver ficheiro

@@ -33,7 +33,7 @@ class Argument(Node):
def __init__(self, name, default=None):
super(Argument, self).__init__()
self._name = name
self._default = None
self._default = default

def __unicode__(self):
start = "{{{" + str(self.name)


+ 2
- 1
mwparserfromhell/parser/tokenizer.py Ver ficheiro

@@ -122,7 +122,8 @@ class Tokenizer(object):
"""Pop the current stack, write *text*, and then write the stack."""
stack = self._pop()
self._write_text(text)
self._write_all(stack)
if stack:
self._write_all(stack)
self._head -= 1

def _read(self, delta=0, wrap=False, strict=False):


Carregando…
Cancelar
Guardar