From dc4ec7d75840880285dc58d7e0975aa96d7ebb1e Mon Sep 17 00:00:00 2001 From: facelessuser Date: Tue, 15 Oct 2024 22:22:38 -0600 Subject: [PATCH] Ensure auto_level is always positive --- pymdownx/blocks/caption.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pymdownx/blocks/caption.py b/pymdownx/blocks/caption.py index ecaebbe6b..c4b6fd875 100644 --- a/pymdownx/blocks/caption.py +++ b/pymdownx/blocks/caption.py @@ -75,7 +75,7 @@ def __init__(self, md, types, config): self.auto = config['auto'] self.prepend = config['prepend'] self.type = '' - self.auto_level = config['auto_level'] + self.auto_level = max(0, config['auto_level']) self.fig_types = types def run(self, doc): @@ -177,7 +177,7 @@ def run(self, doc): del fig.attrib['__figure_level'] -class Fig(Block): +class Caption(Block): """Figure captions.""" NAME = '' @@ -341,7 +341,7 @@ def extendMarkdownBlocks(self, md, block_mgr): block_mgr.register( type( subclass, - (Fig,), + (Caption,), { 'OPTIONS': {}, 'NAME': name,