Skip to content

Commit

Permalink
Now passes wikilinks:blank_with_multiple_texts
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlcctrlv committed Jan 30, 2023
1 parent 849746b commit bd36dd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mwparserfromhell/nodes/wikilink.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, title, args=None):
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

Expand Down Expand Up @@ -88,7 +88,7 @@ def args(self, value):
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
Expand Down

0 comments on commit bd36dd2

Please sign in to comment.