From 894d26f9b12a60c6f51e864e38f078b8d021c532 Mon Sep 17 00:00:00 2001
From: James <33184071+jamesbondless@users.noreply.github.com>
Date: Sun, 29 Oct 2017 01:30:13 +0530
Subject: [PATCH 1/2] Delete youtube.js
Removed youtube.js as it causes compatibility issues
---
lib/plugin/youtube.js | 101 ------------------------------------------
1 file changed, 101 deletions(-)
delete mode 100644 lib/plugin/youtube.js
diff --git a/lib/plugin/youtube.js b/lib/plugin/youtube.js
deleted file mode 100644
index 5bb2869..0000000
--- a/lib/plugin/youtube.js
+++ /dev/null
@@ -1,101 +0,0 @@
-// markdown-it plugin to wrap youtube iframes in a
for styling purposes
-//
-var URL = require('url')
-
-var WRAPPER_START = "
"
-var WRAPPER_END = '
'
-
-// determine whether the given HTML string contains an iframe pointing to a youtube.com URL
-function isYoutubeIframe (content) {
- // look for the src attribute's value
- var attr = content.match(/<\s*iframe[^>]*\bsrc\s*=\s*/)
- if (attr) {
- // mark the location and figure out what kind of quotation mark is delimiting the value
- var position = attr.index + attr[0].length
- var quote = content.charAt(position)
- var substring = content.slice(position + 1)
-
- // now that we've found the first delimiting quotation mark, match
- // everything up to the next instance of the same quotation mark
- var src = substring.match(new RegExp('^[^' + quote + ']*'))
- if (src) {
- var value = src[0]
- // for protocol-relative src, prepend a protocol for URL parsing purposes
- if (value.indexOf('//') === 0) {
- value = 'https:' + value
- }
-
- var url = URL.parse(value)
- return (url.host && url.host.match(/^(\w+\.)?youtube\.com$/))
- }
- }
- return false
-}
-
-module.exports = function (md, opts) {
- // Wrap iframes that appear in HTML blocks
- //
- // In html_block tokens, the entire contents of an HTML block appear as the
- // `.content` property of a single token object. For a standalone `
') {
- tokens[position].content += WRAPPER_END
- }
- }
- }
-
- return originalInlineRule.call(this, tokens, idx, options, env, self)
- }
-}
From 7b097ca4d2c89c24ca9ae58e77fa6669508a432e Mon Sep 17 00:00:00 2001
From: James <33184071+jamesbondless@users.noreply.github.com>
Date: Sun, 29 Oct 2017 01:32:57 +0530
Subject: [PATCH 2/2] Update render.js
Removed youtube.js entry from render.js as file is removed
---
lib/render.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/render.js b/lib/render.js
index 2ff03a3..00d47a0 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -12,7 +12,6 @@ var codeWrap = require('./plugin/code-wrap')
var headingLinks = require('./plugin/heading-links')
var gravatar = require('./plugin/gravatar')
var github = require('./plugin/github')
-var youtube = require('./plugin/youtube')
var cdnImages = require('./plugin/cdn')
var packagize = require('./plugin/packagize')
var htmlHeading = require('./plugin/html-heading')