Benjamin-Dobell / react-native-markdown-view

MarkdownView for React Native
MIT License
190 stars 77 forks source link

Heading rendeing issues #2

Closed terrysahaidak closed 7 years ago

terrysahaidak commented 7 years ago

I have some issue with heading rendering.

I've tried to render this text:

# Heading 1 \n
# Heading 2

It renders like image

But should renders like image

But it requires extra newline character after heading to render like the second screenshot.

# Heading 1 \n
\n
# Heading 2
Jhonte commented 7 years ago

Plus one. Was just about to ask why the extra line-break is needed. Any clue @Benjamin-Dobell? # MarkdownView{'\n'} {'\n'}

terrysahaidak commented 7 years ago

Can we disable that extra-line-break requirement for all cases?

Benjamin-Dobell commented 7 years ago

Definitely agree this is a pain, however the behaviour is inherited from https://github.com/Khan/simple-markdown. Please open an issue there.

I'll happily update the dependency once the issue is fixed.

xvonabur commented 7 years ago

Does anybody has problem with no heading at all on Android? I've tried debug/production builds with simulator/real device, but header does not render at all.

Here is my code:

<MarkdownView>
        ## MarkdownView{'\n'} {'\n'}
        # MarkdownView{'\n'} {'\n'}
        ### MarkdownView{'\n'} {'\n'}
        **React Native** is even better with Markdown!{'\n'}
        {'\n'}

      </MarkdownView>

And it renders like this:

screen shot 2017-08-15 at 22 55 57

I'm using React Native 0.47.1

ariabuckles commented 7 years ago

@Benjamin-Dobell sent you PR #6 to address this!

I might address this in simple-markdown in the future, but I'm going to wait until I'm confident I'm not breaking any existing usecases and that it's the right decision for simple-markdown's high-level goals.