Hi I cannot find anywhere on how to add new lines into this code sample:
<SyntaxHighlighter language='clojure' style={darcula} showLineNumbers={true} wrapLines={true}>
(def a 2) *add a new line break here*
(def b 3)
</SyntaxHighlighter>
Using:
import SyntaxHighlighter from 'react-syntax-highlighter'; import { darcula, docco } from 'react-syntax-highlighter/styles/hljs';
Thanks
答案 0 :(得分:1)
The only solution that I've found is to do it this way:
<SyntaxHighlighter language='clojure' style={darcula} showLineNumbers={true} wrapLines={true}>
{`first line \nsecond line`}
</SyntaxHighlighter>
Also you can put text into the const
const code = `(def a 2) *add a new line break here*
(def b 3)`;