只要在结果所在的 div 的 css 设置:

white-space: pre-line;

然后页面就能成功识别 '\n' 并整齐的显示结果了。

05-12 01:27