Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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 have the text/markdown mimeType', function() {
expect(markdownRendererFactory.mimeTypes).to.deep.equal([
'text/markdown'
]);
});
});
it('should have the text/markdown mimeType', function() {
expect(markdownRendererFactory.mimeTypes).to.deep.equal([
'text/markdown'
]);
});
});