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

Code blocks produce null children prop #144

Closed
hugmanrique opened this issue Jan 5, 2018 · 4 comments
Closed

Code blocks produce null children prop #144

hugmanrique opened this issue Jan 5, 2018 · 4 comments

Comments

@hugmanrique
Copy link
Contributor

I have a Markdown file which contains the following:

['a', 'b'].map { |x| x.uppercase }

By using require('markdown-to-jsx').compiler('<String above>', {}) I'm getting the following JS output:

Chrome console output

As you can see, the second children in that array has a null children instead of the code above. Even though I haven't installed highlight.js, it is being packaged by Webpack.

Single quoute fences also have empty outputs. I'm using version 6.4.0 and React 16.

@quantizor
Copy link
Owner

Single quote fences

I don't think that's a valid GFM syntax. Code fences must always be three backticks.

Also, this is working for me:

```rb
['a', 'b'].map { |x| x.uppercase }
\```

(ignore the escape, needed it so I could put the fence in a fence on github, heh)

@hugmanrique
Copy link
Contributor Author

What I meant with single quote fences are these: hello, which are made with `.

Is the compile function used internally or does it use another method?

@quantizor
Copy link
Owner

Yeah, it's used internally. Hmm... I wonder what the issue could be. That all works fine in React 15.x...

@hugmanrique
Copy link
Contributor Author

Found the issue, it was something to do with how I handle the compile output. Sorry for the spam 😬

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

No branches or pull requests

2 participants