1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Fix the position of title mark when replacing

This commit is contained in:
Abner Soares Alves Junior
2019-02-28 15:07:50 -03:00
committed by Junyoung Choi
parent d81e69bf00
commit 7b9b4d56a7

View File

@@ -931,7 +931,7 @@ export default class CodeEditor extends React.Component {
const replaceTaggedUrl = replacement => { const replaceTaggedUrl = replacement => {
const value = editor.getValue() const value = editor.getValue()
const cursor = editor.getCursor() const cursor = editor.getCursor()
const newValue = titleMark + value.replace(taggedUrl, replacement) const newValue = value.replace(taggedUrl, titleMark + replacement)
const newCursor = Object.assign({}, cursor, { const newCursor = Object.assign({}, cursor, {
ch: cursor.ch + newValue.length - (value.length - titleMark.length) ch: cursor.ch + newValue.length - (value.length - titleMark.length)
}) })