Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parse a [flash] BBCode
// Usage: [flash=width,height]swf_url[/flash]
var body = document.getElementsByTagName("body")[0];
body.innerHTML = body.innerHTML.replace(/\[flash=([0-9]+),([0-9]+)\]((mailto\:|(news|(ht|f)tp(s?))\:\/\/){1}\S+)\[\/flash\]/gi, '<object type="application/x-shockwave-flash" data="$3" width="$1" height="$2"><embed type="application/x-shockwave-flash" width="$1" height="$2" src="$3" /></object>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment