Sfoglia il codice sorgente

Merge branch 'develop' into feature/tables

tags/v0.4
Ben Kurtovic 10 anni fa
parent
commit
67c23651d4
3 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. +2
    -2
      mwparserfromhell/nodes/extras/attribute.py
  2. +2
    -1
      mwparserfromhell/parser/builder.py
  3. +1
    -1
      setup.py

+ 2
- 2
mwparserfromhell/nodes/extras/attribute.py Vedi File

@@ -37,9 +37,9 @@ class Attribute(StringMixIn):
"""

def __init__(self, name, value=None, quotes='"', pad_first=" ",
pad_before_eq="", pad_after_eq=""):
pad_before_eq="", pad_after_eq="", check_quotes=True):
super(Attribute, self).__init__()
if not quotes and self._value_needs_quotes(value):
if check_quotes and not quotes and self._value_needs_quotes(value):
raise ValueError("given value {0!r} requires quotes".format(value))
self._name = name
self._value = value


+ 2
- 1
mwparserfromhell/parser/builder.py Vedi File

@@ -237,7 +237,8 @@ class Builder(object):
else:
name, value = self._pop(), None
return Attribute(name, value, quotes, start.pad_first,
start.pad_before_eq, start.pad_after_eq)
start.pad_before_eq, start.pad_after_eq,
check_quotes=False)
else:
self._write(self._handle_token(token))
raise ParserError("_handle_attribute() missed a close token")


+ 1
- 1
setup.py Vedi File

@@ -32,7 +32,7 @@ from setuptools import setup, find_packages, Extension
from mwparserfromhell import __version__
from mwparserfromhell.compat import py26, py3k

with open("README.rst") as fp:
with open("README.rst", **{'encoding':'utf-8'} if py3k else {}) as fp:
long_docs = fp.read()

tokenizer = Extension("mwparserfromhell.parser._tokenizer",


Caricamento…
Annulla
Salva