Skip to content

Commit

Permalink
Ensure auto_level is always positive
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Oct 16, 2024
1 parent 8d045d7 commit dc4ec7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymdownx/blocks/caption.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -177,7 +177,7 @@ def run(self, doc):
del fig.attrib['__figure_level']


class Fig(Block):
class Caption(Block):
"""Figure captions."""

NAME = ''
Expand Down Expand Up @@ -341,7 +341,7 @@ def extendMarkdownBlocks(self, md, block_mgr):
block_mgr.register(
type(
subclass,
(Fig,),
(Caption,),
{
'OPTIONS': {},
'NAME': name,
Expand Down

0 comments on commit dc4ec7d

Please sign in to comment.