Skip to content

GFM remaining gaps #1136

@ewjoachim

Description

@ewjoachim

Describe the feature you'd like to request

Working on https://github.com/ewjoachim/sphinx-github-changelog which now uses MyST, I'm looking at what GFM syntax elements are not supported by Myst yet, and I wanted to report them here so that someone, maybe, decides to add them. I'm not saying there is an obvious docutils node for each construct here, but I think it's useful to have an idea what the gaps are.

There's also a discussion worth having to see if some of the elements listed (the GitHub specific ones and especially the GitHub-repo) would be better implemented in a third party package to keep myst-parser independant from GitHub (apart that it is already bound by their syntax choices)

What I've found to be missing or different (in no specific order):

GitHub Myst-Parser
Image Image
  • []() links: when GFM interprets them from a project file, / means relative to project root. Elsewhere (PR, comment, release), GFM interprets them normally, same as myst-parser

  • In quoted code, it seems new lines are lost ?

GitHub Myst-Parser
Image Image (the lack of color is probably an issue from my side, I'm not 100% sure on this one)
  • Footnotes crash myst-parser:
Here is a simple footnote[^1].

A footnote can also have multiple lines[^2].

[^1]: My reference.
[^2]: To add line breaks within a footnote, add 2 spaces to the end of a line.  
This is a second line.
GitHub Myst-Parser
Image

Crash:

changelog_text:71: ERROR: Unknown target name: "1". [docutils]
changelog_text:73: ERROR: Unknown target name: "2". [docutils]

(Should this be reported as a bug ? Now that GitHub supports sub-issue, maybe we can make this a sub-issue)

  • #336699 (hex color prefixed by # surrounded by backticks) appears as a specific color thingy in GFM
  • @ewjoachim is a link to a GH profile page (@ewjoachim)
  • https://github.com/executablebooks/MyST-Parser/labels/dependencies is replaced by a pill with the label name and color, linking to that URL ( dependencies Pull requests that update a dependency file ) (only works if the link points to the same repo as the current context of GFM
  • #1135 (🚀 Release v5.1.0 #1135): links to issues/PRs/doscussions

Full markdown used in my tests

# Heading

*emphasis* / **strong** / ~~strikethrough~~ / <sub>sub</sub> / <ins>underlined</ins>
`#336699` / @ewjoachim / https://github.com/executablebooks/MyST-Parser/labels/dependencies / #1135

Emojis:
- 👍 (UTF-8)
- :thumbsup: (short code)
- :shipit: :octocat:  (GH specific) 

[Contribution guidelines for this project](/docs/index.rst)

1. List
2. Next item

- Unordered
- First

- [x] #1
- [ ] https://github.com/octo-org/octo-repo/issues/740
- [ ] Add delight to the experience when all tasks are complete :tada:


- sub 1
> [!NOTE]  
> Highlights information that users should take into account, even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]  
> Crucial information necessary for users to succeed.

> [!WARNING]  
> Critical content demanding immediate user attention due to potential risks.

> [!CAUTION]
> Negative potential consequences of an action.

| foo | bar |
| --- | --- |
| baz | bim |

> # Foo
> bar
> baz


```python
def x():
    pass
```

<details>
<summary>Details</summary>

Details

</details>

<!-- This content will not appear in the rendered Markdown -->

Let's rename \*our-new-project\* to \*our-old-project\*.

![Screenshot of a comment on a GitHub issue showing an image, added in the Markdown, of an Octocat smiling and raising a tentacle.](https://myoctocat.com/assets/images/base-octocat.svg)



Here is a simple footnote[^1].

A footnote can also have multiple lines[^2].

[^1]: My reference.
[^2]: To add line breaks within a footnote, add 2 spaces to the end of a line.  
This is a second line.

As rendered by GitHub

Heading

emphasis / strong / strikethrough / sub / underlined
#336699 / @ewjoachim / dependencies Pull requests that update a dependency file / #1135

Emojis:

  • 👍 (UTF-8)
  • 👍 (short code)
  • :shipit: :octocat: (GH specific)

Contribution guidelines for this project

  1. List
  2. Next item

[!NOTE]
Highlights information that users should take into account, even when skimming.

[!TIP]
Optional information to help a user be more successful.

[!IMPORTANT]
Crucial information necessary for users to succeed.

[!WARNING]
Critical content demanding immediate user attention due to potential risks.

[!CAUTION]
Negative potential consequences of an action.

foo bar
baz bim

Foo

bar
baz

def x():
    pass
Details

Details

Let's rename *our-new-project* to *our-old-project*.

Screenshot of a comment on a GitHub issue showing an image, added in the Markdown, of an Octocat smiling and raising a tentacle.

Here is a simple footnote1.

A footnote can also have multiple lines2.

Describe the solution you'd like

  • Closing the gap
  • Someone to get inspired by this and make a 3rd party plugin that closes the gap
  • Acknowledging in the doc that those constructs are not supported
  • (Fixing the crash on footnoes)

Describe alternatives you've considered

(Not relevant ?)

Footnotes

  1. My reference.

  2. To add line breaks within a footnote, add 2 spaces to the end of a line.
    This is a second line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions