Coder Social home page Coder Social logo

Comments (7)

quantizor avatar quantizor commented on May 27, 2024 1

This is coming in #115

from markdown-to-jsx.

quantizor avatar quantizor commented on May 27, 2024 1

Fixed in v6!

from markdown-to-jsx.

quantizor avatar quantizor commented on May 27, 2024 1

@pcmaffey hmm I think the wrapper override functionality might have gotten lost during the refactor. What I might just do is require React 16.3+ in v7 and wrap with a fragment by default so the wrappers don't need to exist at all.

from markdown-to-jsx.

quantizor avatar quantizor commented on May 27, 2024

Hey there, sorry it took a bit to get back to you.

The bit of code you referenced is only for arbitrary block-level HTML found inside markdown files. However, regular markdown is also wrapped in a "root" <div> if there are multiple blocks; that code exists here: https://github.com/probablyup/markdown-to-jsx/blob/master/index.js#L261-L262

Could you explain your use case in more detail? We could certainly add the functionality, but I'm curious what you need it to accomplish.

from markdown-to-jsx.

theetrain avatar theetrain commented on May 27, 2024

Here is some more background: I'm using react styleguidist to document some in-house components, and I'm dogfooding the components within the documentation's markdown overrides. For example, I'm overriding <strong> elements with my own <Strong /> component. Since sections of elements are wrapped with a div, I created my own <Box /> component that has a bottom margin of 16px to get my desired spacing. However, the line of code I referenced in my previous post outputs a <div> that I cannot override with my component.

from markdown-to-jsx.

pcmaffey avatar pcmaffey commented on May 27, 2024

@probablyup I don't see where this option can be set in the API? Would love to replace root wrapping <div> with <React.Fragment>...

from markdown-to-jsx.

tb avatar tb commented on May 27, 2024

I have a case when I use latest markdown-to-jsx to render formatted h1 content (for highlights with Important **keyword** in title)

With code:

        <h2>
          <Markdown
            options={{
              forceInline: true,
              overrides: {span: Fragment, p: Fragment},
            }}
            children={project.subtitle}
          />
        </h2>

It renders:

<h2><span>Important <strong>keyword</strong>in title</span></h2>

While I would expect:

<h2>Important <strong>keyword</strong>in title</h2>

from markdown-to-jsx.

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.