Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (URLExt.isLocal(path)) {
// Check if it is an image, if so, replace it with our own placeholder
if (path.match(/.*\.(png|apng|svg|jpeg|jpg|bmp|ico|gif|xbm)$/i)) {
return Promise.resolve(UNCHANGED_IMAGE);
}
}
if (!this.innerResolver) {
return Promise.resolve(path);
}
return this.innerResolver.getDownloadUrl(path);
}
}
class NbdimeMarkdownFactory implements IRenderMime.IRendererFactory {
readonly safe = markdownRendererFactory.safe;
readonly mimeTypes = markdownRendererFactory.mimeTypes;
createRenderer(options: IRenderMime.IRendererOptions): IRenderMime.IRenderer {
options.resolver = new MarkdownImageResolver(options.resolver);
return markdownRendererFactory.createRenderer(options);
}
}
let factories: IRenderMime.IRendererFactory[] = [];
for (let f of standardRendererFactories) {
if (f === markdownRendererFactory) {
factories.push(new NbdimeMarkdownFactory());
} else {
factories.push(f);
}
it('should be safe', () => {
expect(markdownRendererFactory.safe).to.equal(true);
});
});
it('should be safe', () => {
expect(markdownRendererFactory.safe).to.equal(true);
});
});