Pro N0.1 前端支持链接、图片显示。发哔哔的时候插入图片链接或网址链接,会自动识别显示。核心代码来自 @黑石 : function urlToLink(str) { var re =/\bhttps?:\/\/(?!\S+(?:jpe?g|png|bmp|gif|webp|gif))\S+/g; var re_forpic =/\bhttps?:\/\/.*?(\.gif|\.jpeg|\.png|\.jpg|\.bmp|\.webp)/g; str =str.replace(re,function (website) { return "<a href='" + website + "' target='_blank'> <i class='iconfont icon-lianjie-copy'></i>链接 </a>"; }); str =str.replace(re_forpic,function (imgurl) { return "<img src='" + imgurl + "' /> "; }); return str; } 完整代码参考本主题 bb.html