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

Switch to different markdown preview renderer #1574

Open
rixx opened this issue Sep 9, 2023 · 0 comments
Open

Switch to different markdown preview renderer #1574

rixx opened this issue Sep 9, 2023 · 0 comments
Labels
good first issue A default GitHub label inviting first time contributors help wanted A default GitHub label inviting outside help javascript Pull requests that update Javascript code stage: up for grabs type: bug Needs fix type: ux

Comments

@rixx
Copy link
Member

rixx commented Sep 9, 2023

Problem and impact

We're using marked.js to render Markdown previews. However, marked.js can only support all of or none of GitHub flavoured Markdown. Our Python implementation, however, isn't GHF, but still supports line breaks (via the nl2br extension). Marked.js has to turn on full GitHub compatibility to support line breaks, which will also e.g. turn on lists working without an empty line beforehand.

Expected behaviour

Preview and actual rendering work the same.

Steps to reproduce

Test text:

This should
display as a line break

but this should
- never be a list

Other inconsistencies

  • The frontend renderer also supports strikethroughs, whereas the backend renderer doesn't. Fixed by 98448c1
  • The frontend and backend renderer disagree on how indented/nested unordered lists work, ie. how much whitespace is needed to trigger the indent. The failure case (very obnoxious) is that the frontend renderer shows an indented list, but the backend renderer outputs a list with all bullet point on the same level. This is because the JavaScript renderer accepts two (or any?) indent for nesting, while the Python renderer requires four spaces. I am on the side of the frontend here, honestly, and we may copy or depend on mdx_truly_sane_lists to fix this.
@rixx rixx added the type: bug Needs fix label Sep 9, 2023
@rixx rixx added stage: up for grabs type: ux help wanted A default GitHub label inviting outside help good first issue A default GitHub label inviting first time contributors javascript Pull requests that update Javascript code labels Apr 30, 2024
rixx added a commit that referenced this issue May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A default GitHub label inviting first time contributors help wanted A default GitHub label inviting outside help javascript Pull requests that update Javascript code stage: up for grabs type: bug Needs fix type: ux
Projects
None yet
Development

No branches or pull requests

1 participant