Skip to content

dollarmath_plugin renderer parameter does not work correctly in 0.3.4 #68

Closed

Description

@abidlabs

Describe the bug

The dollarmath_plugin's renderer parameter does not work after upgrading to 0.3.4. Instead of using the given renderer function to parse the LaTeX, it just returns the name of the renderer function. Here's a simple example for repro:

In <=0.3.3

from markdown_it import MarkdownIt
md = MarkdownIt().use(dollarmath_plugin, renderer=lambda x,y:x).enable("table")

md.render("# Let's learn about $x$")

would produce:

<h1>Let\'s learn about <span class="math inline">x</span></h1>

In 0.3.4

it produces

<h1>Let's learn about <span class="math inline"><function <lambda> at 0x7fd79cb4d940></span></h1>

Reproduce the bug

See above

List your environment

Python 3.9
Windows, Linux

More context

We use the wonderful markdown-it-py and mdit-py-plugins packages in the open-source Gradio library, where we use it to render LaTeX in machine learning demos. We'd love to continue being able to do so, so hoping this bug gets fixed. Thanks!

Activity

  1. added
    bug
    on Feb 19, 2023
  2. welcome commented on Feb 19, 2023

    @welcome

    Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

    If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

    If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

    Welcome to the EBP community! 🎉

  3. linked a pull request that will close this issue🐛 FIX: Regression in dollarmath #69on Feb 19, 2023
  4. chrisjsewell commented on Feb 19, 2023

    @chrisjsewell
    Member

    oops, thanks for pointing out @abidlabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions