Ver a proveniência

Implement _blank_param_value().

tags/v0.1
Ben Kurtovic há 12 anos
ascendente
cometimento
16a58a8c3b
1 ficheiros alterados com 6 adições e 3 eliminações
  1. +6
    -3
      mwparserfromhell/nodes/template.py

+ 6
- 3
mwparserfromhell/nodes/template.py Ver ficheiro

@@ -20,7 +20,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from mwparserfromhell.nodes import HTMLEntity, Node
import re

from mwparserfromhell.nodes import HTMLEntity, Node, Text
from mwparserfromhell.nodes.extras import Parameter
from mwparserfromhell.utils import parse_anything

@@ -47,8 +49,9 @@ class Template(Node):
if char in node:
code.replace(node, node.replace(char, replacement))

def _blank_param_value(self, value): # TODO
pass # MAKE VALUE CONTAIN ABSOLUTELY TWO TEXT NODES: FIRST IS SPACING BEFORE CHUNK AND SECOND IS SPACING AFTER CHUNK
def _blank_param_value(self, value):
match = re.search("^(\s*).*?(\s*)$", value, re.DOTALL|re.UNICODE)
value.nodes = [Text(match.group(1)), Text(match.group(2))]

@property
def name(self):


Carregando…
Cancelar
Guardar