Commit e160cdd9 authored by yann300's avatar yann300

add isExternalURL

parent a7465b56
...@@ -14,7 +14,7 @@ const profile = { ...@@ -14,7 +14,7 @@ const profile = {
name: 'contentImport', name: 'contentImport',
displayName: 'content import', displayName: 'content import',
version: packageJson.version, version: packageJson.version,
methods: ['resolve', 'resolveAndSave'] methods: ['resolve', 'resolveAndSave', 'isExternalUrl']
} }
module.exports = class CompilerImports extends Plugin { module.exports = class CompilerImports extends Plugin {
...@@ -105,6 +105,15 @@ module.exports = class CompilerImports extends Plugin { ...@@ -105,6 +105,15 @@ module.exports = class CompilerImports extends Plugin {
return /^([^/]+)/.exec(url) return /^([^/]+)/.exec(url)
} }
isExternalUrl (url) {
for (const handler of this.handlers()) {
if (handler.match.exec(url)) {
return true
}
}
return false
}
/** /**
* resolve the content of @arg url. This only resolves external URLs. * resolve the content of @arg url. This only resolves external URLs.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment