Sfoglia il codice sorgente

Now passes wikilinks:blank_with_multiple_texts

pull/301/head
Fred Brennan 1 anno fa
parent
commit
bd36dd2b6d
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      src/mwparserfromhell/nodes/wikilink.py

+ 2
- 2
src/mwparserfromhell/nodes/wikilink.py Vedi File

@@ -36,7 +36,7 @@ class Wikilink(Node):
if not '|' in args:
self.text = args
else:
self.text = parse_anything(args).nodes[len(self.args)-1:]
self.text = parse_anything(args).nodes[len(list(a for a in self.args if len(a)))-1:]
else:
self.text = None

@@ -88,7 +88,7 @@ class Wikilink(Node):
if arg := parse_anything(value):
self._args = [node for node in str(arg.nodes[0]).split('|')]
if len(self._args) > 0:
self._text = str(arg)[len('|'.join(str(a) for a in self._args)):]
self._text = str(arg)[len('|'.join(str(a) for a in self._args))-1:]
self._args.pop()
if len(self._text) == 0:
self._text = None


Caricamento…
Annulla
Salva