Code Monkey home page Code Monkey logo

Comments (6)

rexxars avatar rexxars commented on June 6, 2024

Sure. As long as it's backwards compatible, I'll accept a PR.

from react-markdown.

rexxars avatar rexxars commented on June 6, 2024

Since I have not received a PR for this, I assume no one wants it enough to actually put in the effort.
For anyone looking to implement it, simply passing on children to the underlying library isn't quite good enough, as someone might pass in a react element inside of the children. You'd at least have to flatten the tree of children and extract the text nodes. Or throw if non-text nodes are encountered.

from react-markdown.

pke avatar pke commented on June 6, 2024

here here. When I came across the library I was instantly thinking "why isn't it using children as the markdown body?"
I'd treat children as to be only one, a string, and not accept react elements inside it.

from react-markdown.

rexxars avatar rexxars commented on June 6, 2024

Happy to accept a pull request.

from react-markdown.

pke avatar pke commented on June 6, 2024

I am just thinking how the jsx compiler would treat this:

<Markdown>What a **bold** move.</Markdown>

Will it have converted the text into chunks of <span>? Guess I have to try it to find out. Let the forking begin :)

from react-markdown.

pke avatar pke commented on June 6, 2024

@rexxars Hmmm tried to run the tests before doing any dev to see if they are all green and got:

$ npm t

> [email protected] test C:\dev\projects\react-markdown
> mocha --reporter spec



  ReactMarkdown
    1) "before all" hook


  0 passing (3s)
  1 failing

  1) ReactMarkdown "before all" hook:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
      at Object.done (node_modules\mocha-jsdom\index.js:70:7)
      at process.nextTick (node_modules\jsdom\lib\jsdom.js:325:18)
      at _combinedTickCallback (internal/process/next_tick.js:67:7)
      at process._tickCallback (internal/process/next_tick.js:98:9)

from react-markdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.