A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Python-Markdown/markdown/issues/1224 below:

Allow TOC element to use a custom CSS class · Issue #1224 · Python-Markdown/markdown · GitHub

will currently generate the following HTML:

<div class="toc">
  <ul>
    <li><a href="#header-1">Header 1</a></li>
  </ul>
</div>
<h1 id="header-1">Header 1</h1>

The class="toc" cannot be changed, although using custom classes are supported for anchorlinks (anchorlink_class) and permalinks (permalink_class).

I suggest that another config parameter toc_class that defaults to the current class toc is introduced. This is useful if in use with CSS frameworks that apply certain styles to prose content but allow disabling the additional styles when a certain class is present. For TailwindCSS, the extension could be called like so:

md = markdown.Markdown(extensions=[TocExtension(toc_class="toc not-prose")]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4