Include global modifier to regex

This commit is contained in:
cetra3
2016-08-30 18:00:58 +09:30
parent f2c0b68867
commit 0b1c683216

View File

@@ -30,7 +30,6 @@
//Execute Ajax request for content //Execute Ajax request for content
require(["dojo/request", "showdown"], function(request, showdown){ require(["dojo/request", "showdown"], function(request, showdown){
//Once we have the content, let's create a converter and add the html to the div element //Once we have the content, let's create a converter and add the html to the div element
converter = new showdown.Converter({ converter = new showdown.Converter({
extensions: [ extensions: [
@@ -38,7 +37,7 @@
return [{ return [{
type: 'output', type: 'output',
filter: function(source) { filter: function(source) {
return source.replace(/<img src="([^"]*)"/, function(match, src) { return source.replace(/<img src="([^"]*)"/g, function(match, src) {
if(src.startsWith("http")) { if(src.startsWith("http")) {
//if this includes external links, then don't change it. //if this includes external links, then don't change it.