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:
committed by
Junyoung Choi
parent
d81e69bf00
commit
7b9b4d56a7
@@ -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)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user