您好,我在任何地方都找不到如何在此代码示例中添加新行:
<SyntaxHighlighter language='clojure' style={darcula} showLineNumbers={true} wrapLines={true}>
(def a 2) *add a new line break here*
(def b 3)
</SyntaxHighlighter>使用:
从‘反应-语法-荧光’导入样式;从‘反应-语法-荧光/ SyntaxHighlighter /hljs’导入{ darcula,docco };
谢谢
发布于 2018-02-03 16:48:00
我找到的唯一解决方案是这样做:
<SyntaxHighlighter language='clojure' style={darcula} showLineNumbers={true} wrapLines={true}>
{`first line \nsecond line`}
</SyntaxHighlighter>您还可以将文本放入const
const code = `(def a 2) *add a new line break here*
(def b 3)`;https://stackoverflow.com/questions/48595337
复制相似问题