remarkjs / react-markdown

Markdown component for React

Home Page:https://remarkjs.github.io/react-markdown/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support passing 'id' (or any other arbitrary 'div' tags)

CHE1RON opened this issue · comments

Initial checklist

Problem

When rendering Markdown, it wraps all content inside a <div>, but does not provide any means to pass arbitrary or even the most basic props to this element (className being the only one).

I stumbled across #242, which I think is about exactly this, but was discarded as 'add props to components being rendered inside this div tag' - however, the issue still stands 😁

Solution

I'd be happy to open a PR for at least id to be an allowed property - think of aria-labelledby referencing this without having to wrap it in yet another div!

Alternatives

It might be solved by having div props being passed as single argument 🤔

Hey!

We don’t generate a div normally. Only with className.
If you want a div with an id or whatever else, write one:

<div id="x">
  <Markdown><Markdown>
</div>

This seems more like #781. Either we can remove className, and this div, or we can pass all other properties through to a div. Leave a comment there if you feel for one or the other!

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.