summaryrefslogtreecommitdiff
path: root/markdown/extensions/toc.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown/extensions/toc.py')
-rw-r--r--markdown/extensions/toc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/markdown/extensions/toc.py b/markdown/extensions/toc.py
index 57d2e3b..80138b3 100644
--- a/markdown/extensions/toc.py
+++ b/markdown/extensions/toc.py
@@ -160,6 +160,7 @@ class TocTreeprocessor(Treeprocessor):
self.base_level = int(config["baselevel"]) - 1
self.slugify = config["slugify"]
self.sep = config["separator"]
+ self.toc_class = config["toc_class"]
self.use_anchors = parseBoolValue(config["anchorlink"])
self.anchorlink_class = config["anchorlink_class"]
self.use_permalinks = parseBoolValue(config["permalink"], False)
@@ -239,7 +240,7 @@ class TocTreeprocessor(Treeprocessor):
def build_toc_div(self, toc_list):
""" Return a string div given a toc list. """
div = etree.Element("div")
- div.attrib["class"] = "toc"
+ div.attrib["class"] = self.toc_class
# Add title to the div
if self.title:
@@ -328,6 +329,9 @@ class TocExtension(Extension):
"title": ["",
"Title to insert into TOC <div> - "
"Defaults to an empty string"],
+ "toc_class": ['toc',
+ 'CSS class(es) used for the link. '
+ 'Defaults to "toclink"'],
"anchorlink": [False,
"True if header should be a self link - "
"Defaults to False"],