split using regex supporting both crlf and lf types
This commit is contained in:
@@ -10,7 +10,7 @@ export default function EditorTextArea({ code, setCode, language, fontSize }) {
|
|||||||
|
|
||||||
function highlightWithLineNumbers(input, grammar) {
|
function highlightWithLineNumbers(input, grammar) {
|
||||||
return highlight(input, grammar)
|
return highlight(input, grammar)
|
||||||
.split('\n')
|
.split(/\r?\n/)
|
||||||
.map((line, i) => (
|
.map((line, i) => (
|
||||||
<span key={i}>
|
<span key={i}>
|
||||||
<LineNumber
|
<LineNumber
|
||||||
|
|||||||
Reference in New Issue
Block a user