mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Fix some linter issues
This commit is contained in:
committed by
Junyoung Choi
parent
7b9b4d56a7
commit
5ca6bbea11
@@ -863,7 +863,7 @@ export default class CodeEditor extends React.Component {
|
||||
}
|
||||
|
||||
const pastedTxt = clipboard.readText()
|
||||
console.log(pastedTxt);
|
||||
|
||||
if (isInFencedCodeBlock(editor)) {
|
||||
this.handlePasteText(editor, pastedTxt)
|
||||
} else if (fetchUrlTitle && isMarkdownTitleURL(pastedTxt) && !isInLinkTag(editor)) {
|
||||
@@ -908,15 +908,15 @@ export default class CodeEditor extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handlePasteUrl(editor, pastedTxt) {
|
||||
handlePasteUrl (editor, pastedTxt) {
|
||||
let taggedUrl = `<${pastedTxt}>`
|
||||
let urlToFetch = pastedTxt;
|
||||
let titleMark = '';
|
||||
let urlToFetch = pastedTxt
|
||||
let titleMark = ''
|
||||
|
||||
if (isMarkdownTitleURL(pastedTxt)) {
|
||||
const pastedTxtSplitted = pastedTxt.split(' ')
|
||||
titleMark = `${pastedTxtSplitted[0]} `;
|
||||
urlToFetch = pastedTxtSplitted[1];
|
||||
titleMark = `${pastedTxtSplitted[0]} `
|
||||
urlToFetch = pastedTxtSplitted[1]
|
||||
taggedUrl = `<${urlToFetch}>`
|
||||
}
|
||||
|
||||
@@ -931,7 +931,7 @@ export default class CodeEditor extends React.Component {
|
||||
const replaceTaggedUrl = replacement => {
|
||||
const value = editor.getValue()
|
||||
const cursor = editor.getCursor()
|
||||
const newValue = value.replace(taggedUrl, titleMark + replacement)
|
||||
const newValue = value.replace(taggedUrl, titleMark + replacement)
|
||||
const newCursor = Object.assign({}, cursor, {
|
||||
ch: cursor.ch + newValue.length - (value.length - titleMark.length)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user