Skip to content

Issues with inline $$44 + x$$ #330

@bcm-at-zama

Description

@bcm-at-zama

Describe the bug

context

I use this kind of .md:

$$42 + x$$

This is $43 + x$.

This is $$44 + x$$.

The important line is the 3rd one (with 44). I am using $$ instead one $ because my .md is going to be used by GitBook, and it looks this later does not like simple $ . But I also want to use this .md with Sphinx.

Sphinx supports inline $$ .

expectation

I would hope to have an .md after formatting which is still readable.

bug
But instead this is what I get:

$$42 + x$$

This is $43 + x$.

This is \$$44 + x$\$.

Once again, the important thing is the third line. And so, when I sphinx my doc, I get wrong output. Sphinx does not like \$$.

problem

This is a problem for people doing markdowns which are both used by Sphinx and GitBook. Not sure it is a mistake of mdformat, but at least, I was able to have a file mostly usable by both Sphinx and GitBook before using mdformat.

Reproduce the bug

  1. Create foo.md with
$$42 + x$$

This is $43 + x$.

This is $$44 + x$$.
  1. (optional) Try to sphinx this: it is readable

  2. mdformat it

  3. You get

$$42 + x$$

This is $43 + x$.

This is \$$44 + x$\$.
  1. (optional) Try to sphinx this: it is ugly.

List your environment

mdformat --version
mdformat 0.7.14 (mdformat_tables: 0.4.1, mdformat_myst: 0.1.4, mdformat_toc: 0.3.0, mdformat_frontmatter: 0.4.1)

sw_vers
ProductName: macOS
ProductVersion: 11.6
BuildVersion: 20G165

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions