question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-markdown v3.0.0

Summary

Full rewrite based on a new parser. I’d love it if you would try it out and let me know if it works or doesn’t work for you. It can be installed with npm install --save react-markdown@next. Please see list of breaking changes below.

Added

  • Table support!
    • New types: table, tableHead, tableBody, tableRow, tableCell
  • New type: delete (~~foo~~)
  • New type: imageReference
  • New type: linkReference
  • New type: definition
  • Hacky, but basic support for React-native rendering of attributeless HTML nodes (<kbd>, <sub> etc)

BREAKING

  • Container props removed (containerTagName, containerProps), override root renderer instead
  • softBreak option removed. New solution will be added at some point in the future.
  • escapeHtml is now TRUE by default
  • HtmlInline/HtmlBlock are now named html (use isBlock prop to check if inline or block)
  • Renderer names are camelcased and in certain cases, renamed. For instance:
    • Emph => emphasis
    • Item => listItem
    • Code => inlineCode
    • CodeBlock => code
    • linebreak/hardbreak => break
  • All renderers: literal prop is now called value* List renderer: type prop is now a boolean named ordered (Bullet => false, Ordered => true)
  • walker prop removed. Code depending on this will have to be rewritten to use the astPlugins prop, which functions differently.
  • allowNode has new arguments (node, index, parent) - node has different props, see renderer props
  • childBefore and childAfter props removed. Use root renderer instead.
  • parserOptions removed (new parser, so the old options doesn’t make sense anymore)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:8

github_iconTop GitHub Comments

3reactions
rexxarscommented, Nov 11, 2017

They are fairly similar. My main motivation with react-markdown is to provide a “drop-in” component. One dependency that “just works” out of the box, while (in the future) being extendable. I hope (and think) that it fits in the React ecosystem and feels familiar and easy to use.

react-markdown mainly uses the markdown parser from remark and translates to React components directly from the AST (remark-react uses HAST-nodes). One benefit of going straight from markdown AST is that you can (should?) easily create React components to render to other targets, such as React Native. In the future, I hope to be able to utilize the full power of the remark ecosystem while hopefully remaining easy to use.

Another goal is to try and keep the bundle size down as much as possible. I have a couple of ideas in mind for how to achieve smaller builds, but we’ll have to wait and see if that works out.

remark-react embraces and follows the remark/hast set of tools very closely, which makes it really extendable and powerful. In my personal opinion, I find it can be a bit hard to navigate the very large set of plugins and closely related projects within the unified/remark/hast/mdast/vfile sphere.

Thankfully, both projects are free and open-source, so use whichever one works for you! 😃

2reactions
rexxarscommented, Nov 11, 2017

I did consider marked, but it has not been updated for nearly a year with no feedback from the maintainer. There was also a bunch of issues I ran across when attempting to use it that made me look for an alternative.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap 3.0.0 Documentation - BootstrapDocs
Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development. Download Bootstrap. Currently v3.0.0; Bootstrap ...
Read more >
Cake v3.0.0 released
Cake v3.0.0 released. Published: 08 November 2022; Category: Release Notes; Author: devlead. Version 3.0.0 of Cake has been released.
Read more >
Config Spec v3.0.0 - coreos/ignition
Configuration Specification v3.0.0. The Ignition configuration is a JSON document ... The spec version must be compatible with the latest version ( 3.0.0...
Read more >
OpenFOAM 3.0.0
OpenFOAM version 3.0.0 is the first major new version of OpenFOAM since 2011, which breaks some backward compatibility ... Download v3.0.0 | Source...
Read more >
v3.0.0 Upgrade Guide - Blend API Docs
Category Action Previous Route Account Opening GET /account‑applications Account Opening GET /account‑applications/id Account Opening PATCH /account‑applications/id
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found