- Code:
[panda=js]// Hook of forumotion post !
// Inline Quote by SSYT.JS (RO.SSYT)
$(function() {
var $post = $('.post .postbody'), i = 0;
for(i; i < $post.length; i++) {
var x = new RegExp("`(.*?)`", "g");
if(/^http([s]?):\/\/.*/.test(x)) $post[i].innerHTML = $post[i].innerHTML.replace(x, "<span class="inline-quote"><a href="$1">$1</a></span>"); else $post[i].innerHTML = $post[i].innerHTML.replace(x, "<span class="inline-quote">$1</span>");
}
});
How to test/check on var x is url?