-
Notifications
You must be signed in to change notification settings - Fork 95
YAML config works but TOML equivalent does not (issue with pymdownx.blocks.tab slugify setting) #483
Description
Bug description
When using YAML as the project configuration file, the following setup works as expected:
- pymdownx.blocks.tab: # New: content tabs
alternate_style: True
combine_header_slug: True
slugify: !!python/object/apply:pymdownx.slugs.slugify {kwds: {case: lower}}However, when switching to TOML, the same logic no longer works:
[project.markdown_extensions.pymdownx.blocks.tab] # New: content tabs
alternate_style = true
combine_header_slug = true
[project.markdown_extensions.pymdownx.blocks.tab.slugify]
object = "pymdownx.slugs.slugify"
kwds = { case = "lower" }I suspect this might be because YAML can create an instance using !!python/object/apply, while TOML cannot. If so, is there any recommended workaround or alternative approach to work properly with TOML?
Additionally, could it be that when using TOML as the project configuration file, the framework performs some internal handling or conversion for other similar slug functions?
For example:
[project.markdown_extensions.pymdownx.tabbed.slugify]
object = "pymdownx.slugs.slugify"
kwds = { case = "lower" }Related links
Reproduction
Steps to reproduce
-
run the project and check the link anchors. Since the
YAMLconfiguration file is being used, you’ll notice that the anchors correspond directly to the tab values. -
comment out the
YAMLconfiguration and renamezensical-o.tomltozensical.toml. After restarting, check the anchors again — you’ll see that they are now formatted liketab_1_1instead.
Browser
Chrome
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.