Browse Source

Ooh, we can do this!

tags/v0.1
Ben Kurtovic 12 years ago
parent
commit
f7289b340a
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      mwparserfromhell/nodes/template.py
  2. +0
    -3
      mwparserfromhell/nodes/text.py
  3. +3
    -0
      mwparserfromhell/string_mixin.py

+ 2
- 2
mwparserfromhell/nodes/template.py View File

@@ -70,7 +70,7 @@ class Template(Node):
name, value = parse_anything(name), parse_anything(value)
surface_text = value.filter_text(recursive=False)
for node in surface_text:
node.replace("|", "|") # INSERT AS HTMLEntity INSTEAD OF RAW TEXT
value.replace(node, node.replace("|", "|"))

if showkey is None:
if any(["=" in node for node in surface_text]):
@@ -84,7 +84,7 @@ class Template(Node):
showkey = True
elif not showkey:
for node in surface_text:
node.replace("=", "|") # INSERT AS HTMLEntity INSTEAD OF RAW TEXT
value.replace(node, node.replace("=", "|"))

if self.has_param(name):
self.remove_param(name, keep_field=True)


+ 0
- 3
mwparserfromhell/nodes/text.py View File

@@ -34,6 +34,3 @@ class Text(Node):
@property
def value(self):
return self._value

def replace(self, old, new, count): # TODO
pass

+ 3
- 0
mwparserfromhell/string_mixin.py View File

@@ -79,3 +79,6 @@ class StringMixIn(object):
if isinstance(item, StringMixIn):
return unicode(item) in unicode(self)
return item in unicode(self)

def replace(self, old, new, count):
return unicode(self).replace(old, new, count)

Loading…
Cancel
Save