Include global modifier to regex
This commit is contained in:
@@ -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.
|
||||||
|
Reference in New Issue
Block a user