replace(/\r/ig, '<br>').replace(/\n/ig, '<br>') 转载于:https://www.cnblogs.com/zhang9418hn/p/3670037.html