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

ValueError occurs when mkdocs serve #4885

Closed
4 tasks done
tasanuma opened this issue Jan 18, 2023 · 5 comments
Closed
4 tasks done

ValueError occurs when mkdocs serve #4885

tasanuma opened this issue Jan 18, 2023 · 5 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@tasanuma
Copy link

Context

No response

Bug description

When starting the server by mkdocs serve with mkdcoks-9.0.5, the following error occurred.

mkdocs serve --livereload
...
ERROR    -  Error building page 'test.md': '<li>' is not in list
Traceback (most recent call last):
  File "/.../venv/mkdocs/bin/mkdocs", line 10, in <module>
    ...
  File "/.../venv/mkdocs/lib/python3.8/site-packages/material/plugins/search/plugin.py", line 448, in handle_endtag
    index = data.index(f"<{tag}>")
ValueError: '<li>' is not in list

After reverting 6825734, the error doesn't occur.

Related links

Reproduction

example.zip

Steps to reproduce

  1. an article includes a list of a heading.
- #foo
  1. starting the server

Browser

No response

Before submitting

@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Jan 18, 2023
@LandonTClipp
Copy link
Sponsor

LandonTClipp commented Jan 19, 2023

This is also occurring for me. The issue happened with a doc that looked like this:

1. This is some text

    List Title
    -------

    List title text

2. This is more text

Issue only happens from v9.0.3 and above.

@squidfunk
Copy link
Owner

squidfunk commented Jan 19, 2023

Thanks for reporting. @tasanuma please use the built-in info plugin next time – it extracts all necessary information on the plugins that are installed and which runtime Material for MkDocs is running on. This is essential information for debugging.

@squidfunk squidfunk added bug Issue reports a bug and removed needs investigation Issue must be investigated by the maintainers labels Jan 19, 2023
@squidfunk
Copy link
Owner

Fixed in e7013e6. This was just a minor issue when exiting sections as described in #4824 (comment) which was caused by an invalid check. We now set exited section depth to infinity, which will exclude them from further consideration when adding parsed tags and text. I've also verified that all cases in #4824 still work.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jan 19, 2023
@squidfunk
Copy link
Owner

Released as part of 9.0.6.

@tasanuma
Copy link
Author

@squidfunk Sorry my zip is not enough, and thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants