1
0
mirror of https://github.com/trambarhq/relaks-wordpress-example.git synced 2025-09-24 22:41:31 +02:00

Fixed image link (issue #31).

This commit is contained in:
Chung Leong
2019-01-28 12:33:01 +01:00
parent d1fd76c1d4
commit 1b93d96a8e

View File

@@ -151,7 +151,7 @@ class Route {
if (node.name === 'a') {
} else if (node.name === 'img') {
// prepend image URL with site URL
if (node.attribs.src && !_.startsWith(node.attribs.src, /https?:/)) {
if (node.attribs.src && !/^https?:/.test(node.attribs.src)) {
node.attribs.src = siteURL + node.attribs.src;
}
}