(function(module) {
	"use strict";

	var Youtube = {},
		embed = '<iframe class="youtube-plugin" width="640" height="360" src="//www.youtube.com/embed/$1?wmode=opaque" frameborder="0" allowfullscreen></iframe>';

	Youtube.parse = function(postContent, callback) {
		// modified from http://stackoverflow.com/questions/7168987/
		var	regularUrl = /<a href="(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)">.+<\/a>/g,
			embedUrl = /<a href="(?:https?:\/\/)?(?:www\.)youtube.com\/embed\/([\w\-_]+)">.+<\/a>/;

		if (postContent.match(embedUrl)) {
			postContent = postContent.replace(embedUrl, embed);
		} else if (postContent.match(regularUrl)) {
			postContent = postContent.replace(regularUrl, embed);
		}

		callback(null, postContent);
	};

	module.exports = Youtube;
}(module));

@@ -394,18 +394,8 @@
 .com
-%7Cyoutu%5C.be
 )%5C/(
@@ -406,17 +406,101 @@
 tch%5C?v=)
-?
+(.+)%22%3E.+%3C%5C/a%3E/g;%0A%09%09var%09shortUrl = /%3Ca href=%22(?:https?:%5C/%5C/)?(?:www%5C.)?(?:youtu%5C.be)%5C/
 (.+)%22%3E.+
@@ -506,20 +506,23 @@
 +%3C%5C/a%3E/g
-,
+;
 %0A%09%09
+var
 %09embedUr
@@ -702,14 +702,11 @@
 %0A%09%09%7D
- else 
+%0A%09%09
 if (
@@ -798,16 +798,112 @@
 ed);%0A%09%09%7D
+%0A%09%09if (postContent.match(shortUrl)) %7B%0A%09%09%09postContent = postContent.replace(shortUrl, embed);%0A%09%09%7D
 %0A%0A%09%09call

Fix plugin converting user links to videos