Tags plugin: sometimes crashes on empty tags
Context
I'm migrating my docs repo. And was tried to use mkdocs with material theme to build blog somewhat. I use obsidian as the editor. And the default metadata's tags will be empty. Also that I level it empty in most files.
Which looks like:
Author: "@godot42" Date: "{{date}} {{time}}" pub: false pub-category: tags:
But as I enabled the tags plugin, empty tags section will be considered as a exception.
Bug description
The error messages and traceback:
ERROR - Error building page 'Arc/Game/ECS_With_UI.md': 'NoneType' object is not iterable
Traceback (most recent call last):
File "C:\Users\norm\miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\norm\miniconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\norm\miniconda3\Scripts\mkdocs.exe_main.py", line 7, in
Related links
Reproduction
9.5.18-tags_plugins_exception.zip
Steps to reproduce
Run mkdocs when tags of metadata is empty
Browser
No response
Before submitting
- [X] I have read and followed the bug reporting guidelines.
- [X] I have attached links to the documentation, and possibly related issues and discussions.
- [X] I assure that I have removed all customizations before submitting this bug report.
- [X] I have attached a .zip file with a minimal reproduction using the built-in info plugin.
Hello! I noticed that many of my notes currently have empty tags in the metadata section. Are these empty tags considered valid for mkdocs?
I just encountered an exception in the source code related to this when I execute build/serve process to create a blog. And the exception which I've already addressed by making modifications and testing them thoroughly.
Everything seems to be working smoothly now (just made a simple test)🎉🎉! Or are there any spec considerations I might have overlooked?
I have just gone ahead and created a pull request for this issue: https://github.com/squidfunk/mkdocs-material/pull/7098.
Thanks for reporting and creating the PR! I've ran your reproduction, and can't observe the problem. However, looking at the code, your proposed changes definitely make sense to better safe guard against such errors, and I can't rule out that it might be related to some other version of some other package that is causing the problem.
Released as part of 9.5.19