Commit 7a180c29 by Chris Dodge

handle cases where the 'base-asset-url' is undefined, e.g. in Jasmine tests

parent dff33121
......@@ -4,6 +4,8 @@ class @HTMLEditingDescriptor
constructor: (element) ->
@element = element;
@base_asset_url = @element.find("#editor-tab").data('base-asset-url')
if @base_asset_url == undefined
@base_asset_url = null
@advanced_editor = CodeMirror.fromTextArea($(".edit-box", @element)[0], {
mode: "text/html"
......@@ -104,6 +106,9 @@ class @HTMLEditingDescriptor
@showingVisualEditor = false
rewriteStaticLinks: (content, from, to) ->
if from == null || to == null
return content
regex = new RegExp(from, 'g')
return content.replace(regex, to)
......
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