Skip to content
Discussion options

You must be logged in to vote

We don't have a built-in way to do that, but you can plug this logic yourself.


You can create a custom remark plugin that will remove the unwanted paragraphs based on plugin options and some syntax:

# title

:::old 

do not do that

:::

:::new 

do that

:::

Our admonition plugin can be useful for inspiration: https://github.com/elviswolcott/remark-admonitions


You can create a React component and use it in MD (thanks to MDX).
The component will display one text or another according to config it reads through useDocusaurusContext

# My title

Some text

<MyComp
  oldContent={
    <>
    
    Some **markdown text**
    
    </>
  }
  newContent={
    <>
    
    Some **markdown text**
  …

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@mambax
Comment options

@slorber
Comment options

slorber Jun 25, 2021
Collaborator

@mambax
Comment options

@slorber
Comment options

slorber Jun 25, 2021
Collaborator

@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants