|
|
@ -255,12 +255,15 @@ class CodeHtmlFormatter(HtmlFormatter): |
|
|
|
<code class="highlight">...</code> instead (assumes a <pre> is already present). |
|
|
|
""" |
|
|
|
|
|
|
|
def wrap(self, source: Any, outfile: Any) -> Iterator[tuple[int, str]]: |
|
|
|
def wrap(self, source: Any) -> Iterator[tuple[int, str]]: |
|
|
|
"""Wrap the highlighted tokens with the <code> tag.""" |
|
|
|
# pylint: disable=unused-argument |
|
|
|
yield (0, '<code class="highlight">') |
|
|
|
yield 0, '<code class="highlight">' |
|
|
|
yield from source |
|
|
|
yield (0, "</code>") |
|
|
|
yield 0, "</code>" |
|
|
|
|
|
|
|
def _wrap_div(self, inner: Any) -> Iterator[tuple[int, str]]: |
|
|
|
"""Override HtmlFormatter to omit the wrapping <div class="highlight">.""" |
|
|
|
yield from inner |
|
|
|
|
|
|
|
|
|
|
|
def apply_syntax_highlighting(html: str) -> str: |
|
|
|