react-native-markdown icon indicating copy to clipboard operation
react-native-markdown copied to clipboard

Which subset of markdown is implemented?

Open grittathh opened this issue 9 years ago • 3 comments

First of all, thank you for this utility, and thank you for sharing it with everyone. I am new to markdown. The example in your readme works, but very little of this seems to work: https://daringfireball.net/projects/markdown/basics. Am I doing something wrong? It looks like simple-markdown.js is implementing John Gruber's markdown, so his own examples should work?

List of stuff that doesn't work

  1. Headers
  2. Line breaks
  3. Block quotes
  4. Lists
  5. Code blocks
  6. Horizontal rules ...

I'm probably doing something wrong, or maybe it's just not implemented yet. I'd love to help implement missing pieces but just trying to wrap my mind around how things are supposed to work right now. Thanks.

grittathh avatar Nov 21 '15 21:11 grittathh

Hey, I maintain simple-markdown but don't do that much with react-native-markdown (just perusing the issues today ^_^).

The main difference between simple-markdown and Gruber's markdown is that simple-markdown requires an empty line between block elements.

For example, the following doesn't work:

## header
paragraph

while this does:

## header

paragraph

This behaves similarly for codeblocks, lists, horizontal rules, etc in place of "paragraph". This makes the overall grammar much simpler and reduces the complexity of writing extensions, but is technically incompatible. However, if you write your markdown with blank lines between all block elements, it should render correctly in either simple-markdown or Gruber's markdown.

Looking through the source, most of those should be supported. Do you have example text that isn't working?

ariabuckles avatar Feb 18 '16 19:02 ariabuckles

Thanks for getting back to me, I ended up going with another solution (markdown => html => react-native) which worked as I expected. If I ever decide to refactor and get rid of the html step, I'll come back to react-native-markdown and your suggestion hehe.

grittathh avatar Feb 18 '16 19:02 grittathh

Can I suggest adding a note to README.md indicating that this package supports the simple-markdown subset?

ajhyndman avatar Jun 26 '17 08:06 ajhyndman