How to parse the line?

Hi all. Let's say I have a string like: Nhjk\nfjdkfj. I need to parse it in
`Nhjk
fjdkfj
`
. Know what to usnot replace, but do not need it html, need stitching as a result.

parseExerciseName = (name) => {
 return name.replace(`/\n/`, <br/> ) // but will give the html inside the string, and I don't need that
 };
March 12th 20 at 08:00
2 answers
March 12th 20 at 08:02
Solution
You don't need to parse, and to read about hyphenation in html
https://www.w3.org/TR/css-text-3/#white-space-proc...
htmlboss.ru/beginner-lessons/lesson5

March 12th 20 at 08:04
Solution
var str = 'Nhjk\\nfjdkfj';
console.log(str.replace("\\n", "\n"));
Damn console displays standards and UI no(( - genevieve.Ratke41 commented on March 12th 20 at 08:07
@genevieve.Ratke41, you need to look at the code UI, the default HTML does not react to line breaks. Read here on this subject: https://www.w3schools.com/cssref/pr_text_white-spa... - Effie.Jaco commented on March 12th 20 at 08:10
@Effie.Jaco,
Default HTML does not react to line breaks.
actually replaces one space. - Kaci29 commented on March 12th 20 at 08:13

Find more questions by tags JavaScript