1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-12 17:26:17 +00:00

Fix some linter issues

This commit is contained in:
Abner Soares Alves Junior
2019-02-28 15:19:13 -03:00
committed by Junyoung Choi
parent 7b9b4d56a7
commit 5ca6bbea11

View File

@@ -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)
})