Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gfm reader/writer?: support new inline and display math formats #9121

Closed
jgm opened this issue Oct 4, 2023 · 6 comments · Fixed by #9156
Closed

gfm reader/writer?: support new inline and display math formats #9121

jgm opened this issue Oct 4, 2023 · 6 comments · Fixed by #9156
Labels

Comments

@jgm
Copy link
Owner

jgm commented Oct 4, 2023

GitHub now allows this alternative syntax for inline math:

$`x=y^2`$

This should be supported by the reader (will require support in jgm/commonmark-hs) and perhaps the writer.

Also for display math:

``` math
x = y^2 +
3
```
@jgm jgm added the bug label Oct 4, 2023
@jgm
Copy link
Owner Author

jgm commented Oct 22, 2023

$x=y$

@jgm
Copy link
Owner Author

jgm commented Oct 22, 2023

issue9121 branch:

  • Add extension Ext_tex_math_gfm.
  • Add this to gfm extensions (in addition to of Ext_tex_math_dollars)
  • Document in MANUAL.txt. tex_math_gfm adds the two new verbatim constructs.
  • Implement the extension as a pass over the AST after parsing in Text.Pandoc.Readers.Commonmark. Transform: InlineMath that starts and ends with equal-length backtick spans to InlineMath with these stripped off; CodeBlock with class math to Math display. [or should this go in commonmark-extensions?]

@jgm jgm changed the title gfm reader/writer?: support new inline math format gfm reader/writer?: support new inline and display math formats Oct 22, 2023
jgm added a commit that referenced this issue Oct 24, 2023
[API change]

This handles two GitHub-specific syntaxes for math.

And document in MANUAL.txt.

This is now default for `gfm`, in addition to `tex_math_dollars`.

See #9121.
@jgm
Copy link
Owner Author

jgm commented Oct 24, 2023

$$ x = 2 $$

@jgm
Copy link
Owner Author

jgm commented Oct 24, 2023

$x = \text{y and $z$}$

$x = \text{y and $z$}$

jgm added a commit that referenced this issue Oct 24, 2023
@jgm jgm closed this as completed in #9156 Oct 24, 2023
jgm added a commit that referenced this issue Oct 24, 2023
[API change]

This handles two GitHub-specific syntaxes for math.

And document in MANUAL.txt.

This is now default for `gfm`, in addition to `tex_math_dollars`.

See #9121.
jgm added a commit that referenced this issue Oct 24, 2023
@digitalmoksha
Copy link

I think this support is awesome! 🚀

Just have to say that GitLab pioneered/added (ok I don't know if it was the absolute first one) in 2016, https://about.gitlab.com/releases/2016/12/22/gitlab-8-15-released/, in their GLFM syntax. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants