Skip to content

Commit

Permalink
Fix typo (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
agatemosu committed Dec 20, 2023
1 parent dbff98b commit 0f37bc6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions marko/ext/toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
pip install marko[toc]
Arguments:
* openning: the openning tag, defaults to <ul>
* opening: the opening tag, defaults to <ul>
* closing: the closing tag, defaults to </ul>
* item_format: the toc item format, defaults to '<li><a href="#{slug}">{text}</a></li>'
Expand All @@ -31,7 +31,7 @@


class TocRendererMixin:
openning = "<ul>"
opening = "<ul>"
closing = "</ul>"
item_format = '<li><a href="#{slug}">{text}</a></li>'

Expand All @@ -52,10 +52,10 @@ def render_toc(self, maxdepth=3):
if first_level is None:
first_level = level
last_level = level
rv.append(self.openning + "\n")
rv.append(self.opening + "\n")

if last_level == level - 1:
rv.append(self.openning + "\n")
rv.append(self.opening + "\n")
last_level = level
while last_level > level:
rv.append(self.closing + "\n")
Expand All @@ -75,10 +75,10 @@ def render_heading(self, element):
return '<h{0} id="{1}">{2}</h{0}>\n'.format(element.level, slug, children)


def make_extension(openning=None, closing=None, item_format=None):
def make_extension(opening=None, closing=None, item_format=None):
options = {}
if openning:
options["openning"] = openning
if opening:
options["opening"] = opening
if closing:
options["closing"] = closing
if item_format:
Expand Down

0 comments on commit 0f37bc6

Please sign in to comment.