Line breaks in textarea are not displayed

if you want to implement a preview function, what you type in textarea will be displayed in the preview module. But it is found that line breaks and spaces are ignored. How to solve this problem?

clipboard.png

Jun.04,2021

Preview module style try adding white-space: pre;

Menu