Skip to content

Stop generators causing invalid output from render_toc_ul#407

Closed
codemicro wants to merge 1 commit intolepture:masterfrom
codemicro:fix-truthy-toc-generators
Closed

Stop generators causing invalid output from render_toc_ul#407
codemicro wants to merge 1 commit intolepture:masterfrom
codemicro:fix-truthy-toc-generators

Conversation

@codemicro
Copy link
Copy Markdown

This PR fixes the following behaviour:

>> from mistune.toc import render_toc_ul
>>> render_toc_ul([])
''
>>> render_toc_ul(filter(lambda _: False, []))
'<ul>\n</li>\n</ul>\n'

@lepture
Copy link
Copy Markdown
Owner

lepture commented Jan 28, 2025

Hi, thanks for the report. I've fixed this issue with another way.

@lepture lepture closed this Jan 28, 2025
@codemicro codemicro deleted the fix-truthy-toc-generators branch January 28, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants