react-native-markdown
react-native-markdown copied to clipboard
Which subset of markdown is implemented?
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
- Headers
- Line breaks
- Block quotes
- Lists
- Code blocks
- 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.
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?
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.
Can I suggest adding a note to README.md
indicating that this package supports the simple-markdown
subset?