0

My site is made using react-static and now I want to add remark-gfm.

To have a code snippet I use three ticks. To create a multiline section, I have to use a single tick. This breaks the triple tick code indicator.

My question is how to make multiline seconds so I can just copy paste my premade markdown files?

In the example I have a const markdown to show what works and how multiline breaks.

import React from 'react'
import ReactDom from 'react-dom'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'

const markdown = "```tmux ls```"
const multiline = `start tmux with 
                  ```tmux ls ```
                  `



export default () => (
            <ReactMarkdown children={markdown} remarkPlugins={[remarkGfm]} />

)
isherwood
  • 58,414
  • 16
  • 114
  • 157
OrigamiEye
  • 864
  • 1
  • 12
  • 31
  • 1
    Are you asking how to use backticks in template literals (which are enclosed with backticks)? The usual approach to this general problem is to escape with backslashes: `\\`\\`\\`` – isherwood Jan 25 '22 at 20:11
  • See [Template literals with nested backticks(`) in ES6](https://stackoverflow.com/questions/35803959/template-literals-with-nested-backticks-in-es6) – isherwood Jan 25 '22 at 20:13

0 Answers0