1

I am working on a portal which allow the examiner to provide a problem statement along with sample input and sample output. The issue is that when value is added to the sample input/output section it is stored as a complete string and line breaks are not getting rendered on the candidate side. Let me show you an example to make it more clear:

enter image description here

enter image description here

You can see how the line breaks doesn't get rendered on the candidate side. What changes should i make which will allow me render text properly on client side. Frontend: React Backend: Nodejs

aryan
  • 43
  • 3

1 Answers1

0

You can achieve desired result by using white-space: "pre-wrap".

aryan
  • 43
  • 3