React-markdown: ID's passed to ReactMarkdown not showing in the output

Created on 7 Nov 2018  路  2Comments  路  Source: remarkjs/react-markdown

I need to pass down an id and class to a component.
However the id is not showing in the output.

<ReactMarkdown id="preview" className="markdown-output" source={display} skipHtml={false} escapeHtml={false} renderers={{ code: CodeBlock , link: LinkRenderer }} /> ); }

Only results to :

<div class="markdown-output">

Can you please guide me so that the output includes the id ="preview".

Thank you very much.

馃檵 typquestion

All 2 comments

@niccololampa if you are interested in adding an id/class, consider using a custom renderer https://github.com/rexxars/react-markdown#options and/or using a remark plugin https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins

This issue is not enough to go on, but Christian鈥檚 answer should indeed work.

Was this page helpful?
0 / 5 - 0 ratings