Closed Mara-Li closed 1 year ago
Thanks for reporting. Could you please try and provide a minimal reproduction? Otherwise I'm unable to debug. Thanks!
I get a similar error without any plugins and have removed all customisations from my .yml and made it this minimal...
site_name: JScript Panel 3
copyright: Copyright © 2022 marc2003
strict: true
theme:
name: material
INFO - Building documentation...
INFO - Cleaning site directory
ERROR - Error building page 'gallery/album-art.md': not enough values to unpack (expected 2, got 1)
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\mkdocs\__main__.py", line 234, in serve_command
serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\mkdocs\commands\serve.py", line 83, in serve
builder(config)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\mkdocs\commands\serve.py", line 76, in builder
build(config, live_server=live_server, dirty=dirty)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\mkdocs\commands\build.py", line 329, in build
_build_page(file.page, config, doc_files, nav, env, dirty)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\mkdocs\commands\build.py", line 226, in _build_page
context = config.plugins.run_event(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\mkdocs\plugins.py", line 520, in run_event
result = method(item, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\material\plugins\search\plugin.py", line 90, in on_page_context
self.search_index.add_entry_from_context(page)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\material\plugins\search\plugin.py", line 143, in add_entry_from_context
parser.feed(page.content)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 110, in feed
self.goahead(0)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 172, in goahead
k = self.parse_endtag(i)
^^^^^^^^^^^^^^^^^^^^
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\html\parser.py", line 413, in parse_endtag
self.handle_endtag(elem)
File "D:\Users\marc\AppData\Local\Programs\Python\Python311\Lib\site-packages\material\plugins\search\plugin.py", line 415, in handle_endtag
prev, last = data[-2:]
^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
It seems to be choking on images...
If the markdown document starts with one it breaks...
![album art](../images/album-art.png)
If I insert some plain text before, it breaks...
Some text
![album art](../images/album-art.png)
However, if you insert a heading, it's OK...
# blah
![album art](../images/album-art.png)
Inserting an admonition first also works,,
!!! note
blah
![album art](../images/album-art.png)
Thank you! I come to the same conclusion in my side !
So, a minimal testing file can be :
---
date: 08-12-2022
title: 'My journey'
---
![](random_image.png)
and:
---
date: 08-12-2022
title: 'My journey'
---
Looks at the photo i take:
![](random_image.png)
So in reality, it's not connected to ezlinks!
Thanks for the input, I'm able to reproduce the error.
Fixed in ad2c800bc43120bd5581f212e369d8f3eaab2fd1. Please try the tip of feature/material-v9
branch, and check if the error is gone:
pip install https://github.com/squidfunk/mkdocs-material/archive/feature/material-v9.zip
Yep that fixes it, thanks.
But I have a new unrelated issue incoming. I'll start my own when I've got a minimal repro. :grin:
Work like a charm for me!
Perfect, thanks for testing!
Released as 9.0.0b3.
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
Hello! During build, I have this error :
ValueError: not enough values to unpack (expected 2, got 1)
Complete error :
It seems the bug is connected to my plugin ezlinked but I think it can be forced by any non closed tags, or empty links.
When I try to debug this, with adding a local
try/except ValueError
I got this :Expected behaviour
The building process normally.
Actual behaviour
A crash occur.
Steps to reproduce
mkdocs serve
Package versions
Configuration
System information