Skip to content

Add option to render Markdown inside <div> blocks #488

@asadovsky

Description

@asadovsky

Hi,

First: thanks for writing this fantastic library!

My issue: I'm using Markdown in documentation for a project, and would like to use <div> tags inside of the Markdown to specify that certain sections should be hidden (or otherwise stylized).

For example:

# Title

This is some text.

<div class="toggle-hide">
## Hidden section

A hidden paragraph.
</div>

This text is visible.

Unfortunately, the Markdown content inside the <div> does not get rendered -- it's copied verbatim into the output.

Is there any way to configure marked.js to render Markdown inside of <div> tags? If not: can you point me in the right direction for how to add such an option? Or: can you recommend some alternate strategy for hiding (or toggling visibility of) sections of content?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    L1 - brokenValid usage causes incorrect output OR a crash AND there is no known workaround for the issuecategory: mixed content

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions