change blog regex to look for src's which start with a slash

This commit is contained in:
Henry Oswald 2016-09-20 15:43:36 +01:00
parent d4863ae148
commit 1a67e4982e

View file

@ -28,7 +28,7 @@ module.exports = BlogController =
try try
data = JSON.parse(data) data = JSON.parse(data)
if settings.cdn?.web?.host? if settings.cdn?.web?.host?
data?.content = data?.content?.replace(/src="([^"\:]+)"/g, "src='#{settings.cdn?.web?.host}$1'"); data?.content = data?.content?.replace(/src="(\/[^"]+)"/g, "src='#{settings.cdn?.web?.host}$1'");
catch err catch err
logger.err err:err, data:data, "error parsing data from data" logger.err err:err, data:data, "error parsing data from data"
res.render "blog/blog_holder", data res.render "blog/blog_holder", data