bystartw_tw@tg says to YSITD/** * 自動產生連結。 * * @param {string} text 要處理的字串。 * @return {string} 處理好的字串。 */ function autohref(text) { httpPattern = /(http|https):\/\/.+/ toOutput = '' for (t of text.split(' ')) { if (t.match(httpPattern)) { toOutput += `<a href='${t}'>${t}</a>` + ' ' } else { toOutput += t + ' ' } } return toOutput }at Sat, Aug 10, 2019 10:50 PM