facelessuser / pymdown-extensions

Extensions for Python Markdown
https://facelessuser.github.io/pymdown-extensions/
Other
941 stars 251 forks source link

Deprecation warnings from `tabbed` extension during mkdocs serve or build #2349

Closed FredZinelli closed 4 months ago

FredZinelli commented 4 months ago

Description

Hello,

I just wanted to let you know that after some recent update (I think it comes from the latest Markdown release to 3.6, but I'm not entirely sure), two deprecation warnings are showing up, when using the slugify option in your tabbed extension:

INFO    -  DeprecationWarning: 'get_name' is deprecated. Use `render_inner_html` and `striptags` instead.
  File "/builds/.../.venv/lib/python3.10/site-packages/pymdownx/tabbed.py", line 377, in run
    text = toc.get_name(label)
  File "/builds/.../.venv/lib/python3.10/site-packages/markdown/util.py", line 128, in deprecated_func
    warnings.warn(
INFO    -  DeprecationWarning: 'stashedHTML2text' is deprecated. Use `run_postprocessors`, `render_inner_html` and/or `striptags` instead.
  File "/builds/.../.venv/lib/python3.10/site-packages/pymdownx/tabbed.py", line 378, in run
    innertext = toc.unescape(toc.stashedHTML2text(text, self.md))
  File "/builds/.../.venv/lib/python3.10/site-packages/markdown/util.py", line 128, in deprecated_func
    warnings.warn(

Minimal Reproduction

pyproject.toml:

[tool.poetry]
name = "pymdext-repro"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
packages = [{include = "pymdext_repro"}]

[tool.poetry.dependencies]
python = "^3.8"
mkdocs-material = "^9.5.17"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

docs/index.md:

=== "Hi there"
    Duh ?

mkdocs.yml:

site_name: pymdext-repro
site_description: pymdext-repro
site_author: any

theme:
  name: material

markdown_extensions:
  - pymdownx.tabbed:
      slugify: !!python/object/apply:pymdownx.slugs.slugify
        kwds:
          case: lower

Removing the slugify section suppresses the warnings.

Version(s) & System Info

facelessuser commented 4 months ago

This is already fixed on main via #2347

FredZinelli commented 4 months ago

Oh, sorry, I didn't see it. I guess the updated version will come out soon?

facelessuser commented 4 months ago

I wasn't rushing to get a release as it is only a warning. I imagine if i don't have any other issues or planned work in the next few days, I'll probably cut a new release.