Skip to content

Commit

Permalink
cleanup useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Nov 25, 2022
1 parent 6c43c50 commit a77ec39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mistune/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def use(self, plugin):
plugin(self)

def render_state(self, state: BlockState):
data = self._iter_render(state.tokens, state, None)
data = self._iter_render(state.tokens, state)
if self.renderer:
return self.renderer(data, state)
return list(data)

def _iter_render(self, tokens, state, parent):
def _iter_render(self, tokens, state):
for tok in tokens:
if 'children' in tok:
children = self._iter_render(tok['children'], state, tok)
children = self._iter_render(tok['children'], state)
tok['children'] = list(children)
elif 'text' in tok:
text = tok.pop('text')
Expand Down
2 changes: 0 additions & 2 deletions mistune/renderers/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def render_token(self, token, state):
text = token['raw']
elif 'children' in token:
text = self.render_tokens(token['children'], state)
elif 'text' in token:
text = token['text']
else:
if attrs:
return func(**attrs)
Expand Down

0 comments on commit a77ec39

Please sign in to comment.