From 7b9b4d56a7ac8840a80ef75da38cad358a25c154 Mon Sep 17 00:00:00 2001 From: Abner Soares Alves Junior Date: Thu, 28 Feb 2019 15:07:50 -0300 Subject: [PATCH] Fix the position of title mark when replacing --- browser/components/CodeEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index fcea5dd7..aa294e07 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -931,7 +931,7 @@ export default class CodeEditor extends React.Component { const replaceTaggedUrl = replacement => { const value = editor.getValue() const cursor = editor.getCursor() - const newValue = titleMark + value.replace(taggedUrl, replacement) + const newValue = value.replace(taggedUrl, titleMark + replacement) const newCursor = Object.assign({}, cursor, { ch: cursor.ch + newValue.length - (value.length - titleMark.length) })