frontend: Try to preserve the formatting in the input text

Use white-space: pre in the output div so that formatting gets preserved.