Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - rewrote smart list #235

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mwparserfromhell/parser/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ..nodes import (Argument, Comment, ExternalLink, Heading, HTMLEntity, Tag,
Template, Text, Wikilink)
from ..nodes.extras import Attribute, Parameter
from ..smart_list import SmartList
from ..smart_list import smart_list
from ..wikicode import Wikicode

__all__ = ["Builder"]
Expand Down Expand Up @@ -67,7 +67,7 @@ def _pop(self):
The raw node list is wrapped in a :class:`.SmartList` and then in a
:class:`.Wikicode` object.
"""
return Wikicode(SmartList(self._stacks.pop()))
return Wikicode(smart_list(self._stacks.pop()))

def _write(self, item):
"""Append a node to the current node list."""
Expand All @@ -92,7 +92,7 @@ def _handle_parameter(self, default):
self._tokens.append(token)
value = self._pop()
if key is None:
key = Wikicode(SmartList([Text(str(default))]))
key = Wikicode(smart_list([Text(str(default))]))
return Parameter(key, value, showkey)
else:
self._write(self._handle_token(token))
Expand Down
Loading