Revert "Fixed CDN urls to Static urls on edit."

This commit is contained in:
Muhammad Zaid Bamber
2019-07-26 11:42:15 +05:00
committed by GitHub
parent b793c5e791
commit b7d4f30769
3 changed files with 0 additions and 31 deletions

View File

@@ -35,13 +35,5 @@ window.rewriteStaticLinks = function(content, from, to) {
// escape all regex interpretable chars
fromRe = from.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
var regex = new RegExp('(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_\+.~#?&//=]*))?' + fromRe, 'g');
return content.replace(regex, replacer);
};
// Utility method for replacing absolute URLs
window.rewriteCdnLinksToStatic = function(content) {
'use strict';
var regex = new RegExp('((https?:)?[/][/](www.)?[-a-zA-Z0-9@:%._+~#=]{2,256}[a-z]{2,6}([-a-zA-Z0-9@:%_+~#?&//=]*)|[a-z-]{14})[/]', 'g');// eslint-disable-line max-len
return content.replace(regex, '/static/');
};