<script type="text/javascript">
// 填写JavaScript
function link(){
const div = document.querySelector('#jsContainer');
let text = div.innerText;;
// let arr = text.match(/(https:\/\/www\.\w+\.com(\.\w+)*\??(\w+=.+)*|http:\/\/www\.\w+\.com(\.\w+)*\??(\w+=.+)*|www\.\w+\.com(\.\w+)*\??(\w+=\S+)*)/g);
let arr = text.match(/(http(s)?:\/\/www\.\w+\.com(\.\w+)*\??(\w+=.+)*|www\.\w+\.com(\.\w+)*\??(\w+=\S+)*)/g);
if (arr) {
arr.forEach(item => {
if (/^www./.test(item)) {
text = text.replace(item, `<a href='http://${item}' target="_blank" >${item}</a>`)
} else {
text = text.replace(item, `<a href='${item}' target="_blank" >${item}</a>`)
}
})
}
div.innerHTML = text
}
</script>