From 08dd36e1b0cb377c4982f0654bf0713e408de4c4 Mon Sep 17 00:00:00 2001 From: Andrew Jaeger Date: Sat, 8 Feb 2014 14:18:36 -0800 Subject: [PATCH] In the javascript editor, '$' characters were getting stomped on when trying to remove backreferences after doing transformations on text (Bolding, Italicizing, etc.). This can be fixed by first escaping the string to be transformed and then unescaping it afterwards. --- lib/gollum/public/gollum/javascript/editor/gollum.editor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gollum/public/gollum/javascript/editor/gollum.editor.js b/lib/gollum/public/gollum/javascript/editor/gollum.editor.js index 2f9b4fcc..3b281e7f 100755 --- a/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +++ b/lib/gollum/public/gollum/javascript/editor/gollum.editor.js @@ -546,9 +546,12 @@ typeof definitionObject.replace == 'string' ) { debug('Running replacement - using ' + definitionObject.replace); var rt = definitionObject.replace; + + repText = escape( repText ); repText = repText.replace( searchExp, rt ); // remove backreferences repText = repText.replace( /\$[\d]/g, '' ); + repText = unescape( repText ); if ( repText === '' ) { debug('Search string is empty');