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

Markdown: Replace marked with showdown parser/printer #577

Closed
wants to merge 1 commit into from

Conversation

dmsnell
Copy link
Member

@dmsnell dmsnell commented Jun 30, 2017

marked doesn't appear to have been maintained for a while while
showdown has more recent contributions. Further, marked was missing
some functionality that we wanted. Namely, we wanted an equivalence with
Github-flavored Markdown (gfm) and showdown does it better.

In this patch we've changed the way we are inserting the content.
Instead of using dangerouslySetInnerHTML we're statefully rendering
the content into the DOM and then manipulating it. This change provides
an easier way to interact with the rendered content because we can
operate at the DOM level instead of at the string level. For example,
this is how highlighting now gets inserted.

Notable changes

  • Todo items render (though they can only be changed in the plaintext
    view)
  • Tables render
  • Code blocks highlight based on their language
  • Certain dirty/malicious content gets sanitized before display

Questions

  • Since the todo items render but aren't editable it could be confusing
    for someone to use, misleading them into thinking it's supposed to
    work

`marked` doesn't appear to have been maintained for a while while
`showdown` has more recent contributions. Further, `marked` was missing
some functionality that we wanted. Namely, we wanted an equivalence with
Github-flavored Markdown (gfm) and `showdown` does it better.

In this patch we've changed the way we are inserting the content.
Instead of using `dangerouslySetInnerHTML` we're statefully rendering
the content into the DOM and then manipulating it. This change provides
an easier way to interact with the rendered content because we can
operate at the DOM level instead of at the string level. For example,
this is how highlighting now gets inserted.

**Notable changes**
 - Todo items render (though they can only be changed in the plaintext
   view)
 - Tables render
 - Code blocks highlight based on their language
 - Certain dirty/malicious content gets sanitized before display

**Questions**
 - Since the todo items render but aren't editable it could be confusing
   for someone to use, misleading them into thinking it's supposed to
   work
@dmsnell
Copy link
Member Author

dmsnell commented Jul 6, 2017

Obviated by the merge of #579

@dmsnell dmsnell closed this Jul 6, 2017
@belcherj belcherj deleted the markdown/marked-to-showdown branch October 18, 2019 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant