GFM elements (strikethrough, tables, alerts, bare autolinks) crash the LatexRenderer with NotImplementedError

Open
#297 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@rahul05ranjan is already working on this.

Since Nov 9, 2026.

  • #298 by @rahul05ranjan — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
latex, markdown, python
Domain
backend

Research direction

Start with the GFM renderer mixin, which registers render_strikethrough, the table renderers, render_alert and render_url only for the HTML and Markdown renderers, and with the LatexRenderer in marko/ext/latex_renderer. Reproduce with the snippet in the issue to confirm the NotImplementedError from helpers.super_render. Pull request #298 is already open against this issue, so check it before starting. Done means all four element types render to LaTeX without raising.

Written by the indexing model from the issue text.

Description

GFM elements crash the LatexRenderer with an opaque NotImplementedError

What happens

LatexRenderer is documented in docs/extend.rst ("renders elements as LaTeX document"), but combining it with the GFM extension crashes for four of the extension's element types instead of rendering: strikethrough, tables, alerts, and bare autolinks all raise

NotImplementedError: Unsupported renderer <class 'marko._Renderer'>

Repro on current master (2.2.5, system Python 3.13):

from marko import Markdown
from marko.ext.latex_renderer import LatexRenderer

md = Markdown(renderer=LatexRenderer, extensions=["gfm"])
for text in [
    "~~struck~~",
    "| a | b |\n|---|---|\n| 1 | 2 |\n",
    "> [!NOTE]\n> content\n",
    "visit http://example.com/x_y now\n",
]:
    try:
        md.convert(text)
    except NotImplementedError as e:
        print("CRASH:", text.splitlines()[0], "->", e)

Output:

CRASH: ~~struck~~ -> Unsupported renderer <class 'marko._Renderer'>
CRASH: | a | b | -> Unsupported renderer <class 'marko._Renderer'>
CRASH: > [!NOTE] -> Unsupported renderer <class 'marko._Renderer'>
CRASH: visit http://example.com/x_y now -> Unsupported renderer <class 'marko._Renderer'>

Why

The GFM renderer mixin registers render_strikethrough, render_table/render_table_row/render_table_cell, render_alert, and render_url only for the HTML and Markdown renderers, so with LatexRenderer the render_dispatch fallback (helpers.super_render) walks the MRO, finds no other implementation, and raises. The message naming marko._Renderer doesn't point at the missing element handler at all, and the exception kills the whole document conversion — one ~~word~~ anywhere in a file makes the entire LaTeX output unusable.

Inline HTML gets a logger.warning and renders as empty when unsupported; these four element types shouldn't be worse than that. Concrete suggestions, following the renderer's existing conventions:

  • ~~x~~ → \st{x} (soul package, the way emphasis already becomes \textit)
  • tables → a tabular environment with \hline around the header, column spec from the delimiter row alignments
  • [!NOTE] alerts → the displayquote environment already used for quotes, prefixed with the alert type label
  • bare autolinks → \url{dest}, exactly what render_auto_link already emits for <...> autolinks

Happy to put up a patch along these lines unless something is already in progress.

Dominant language
Python
Stars
470
Forks
72
Avg merge
1d 18h
Merged PRs (30d)
34

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from frostming/marko

All issues in frostming/marko

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.