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

Fix lint error

This commit is contained in:
Junyoung Choi
2018-04-26 16:35:47 -07:00
parent b33e6b232c
commit 2e3e0bc1d8
5 changed files with 29 additions and 29 deletions

View File

@@ -249,24 +249,24 @@ class MarkdownEditor extends React.Component {
? 'codeEditor' ? 'codeEditor'
: 'codeEditor--hide' : 'codeEditor--hide'
} }
ref='code' ref='code'
mode='GitHub Flavored Markdown' mode='GitHub Flavored Markdown'
value={value} value={value}
theme={config.editor.theme} theme={config.editor.theme}
keyMap={config.editor.keyMap} keyMap={config.editor.keyMap}
fontFamily={config.editor.fontFamily} fontFamily={config.editor.fontFamily}
fontSize={editorFontSize} fontSize={editorFontSize}
indentType={config.editor.indentType} indentType={config.editor.indentType}
indentSize={editorIndentSize} indentSize={editorIndentSize}
enableRulers={config.editor.enableRulers} enableRulers={config.editor.enableRulers}
rulers={config.editor.rulers} rulers={config.editor.rulers}
displayLineNumbers={config.editor.displayLineNumbers} displayLineNumbers={config.editor.displayLineNumbers}
scrollPastEnd={config.editor.scrollPastEnd} scrollPastEnd={config.editor.scrollPastEnd}
storageKey={storageKey} storageKey={storageKey}
noteKey={noteKey} noteKey={noteKey}
fetchUrlTitle={config.editor.fetchUrlTitle} fetchUrlTitle={config.editor.fetchUrlTitle}
onChange={(e) => this.handleChange(e)} onChange={(e) => this.handleChange(e)}
onBlur={(e) => this.handleBlur(e)} onBlur={(e) => this.handleBlur(e)}
/> />
<MarkdownPreview styleName={this.state.status === 'PREVIEW' <MarkdownPreview styleName={this.state.status === 'PREVIEW'
? 'preview' ? 'preview'

View File

@@ -2,7 +2,7 @@ const fs = require('fs')
const path = require('path') const path = require('path')
const { findStorage } = require('browser/lib/findStorage') const { findStorage } = require('browser/lib/findStorage')
//TODO: ehhc: delete this // TODO: ehhc: delete this
/** /**
* @description Copy an image and return the path. * @description Copy an image and return the path.

View File

@@ -6,7 +6,7 @@ const fs = require('fs')
const path = require('path') const path = require('path')
const LOCAL_STORED_REGEX = /!\[(.*?)]\(\s*?\/:storage\/(.*\.\S*?)\)/gi const LOCAL_STORED_REGEX = /!\[(.*?)]\(\s*?\/:storage\/(.*\.\S*?)\)/gi
//TODO: ehhc: check this -> attachmentManagement // TODO: ehhc: check this -> attachmentManagement
const IMAGES_FOLDER_NAME = 'images' const IMAGES_FOLDER_NAME = 'images'
/** /**

View File

@@ -77,7 +77,7 @@ function moveNote (storageKey, noteKey, newStorageKey, newFolderKey) {
while (match != null) { while (match != null) {
const [, filename] = match const [, filename] = match
const oldPath = path.join(oldStorage.path, 'images', filename) const oldPath = path.join(oldStorage.path, 'images', filename)
//TODO: ehhc: attachmentManagement // TODO: ehhc: attachmentManagement
moveTasks.push( moveTasks.push(
copyImage(oldPath, noteData.storage, false) copyImage(oldPath, noteData.storage, false)
.then(() => { .then(() => {

View File

@@ -114,8 +114,8 @@ it('should test that copyAttachment don\'t uses a random file name if not intend
}) })
it('should replace the all ":storage" path with the actual storage path', function () { it('should replace the all ":storage" path with the actual storage path', function () {
let storageFolder = systemUnderTest.DESTINATION_FOLDER const storageFolder = systemUnderTest.DESTINATION_FOLDER
let testInput = const testInput =
'<html>\n' + '<html>\n' +
' <head>\n' + ' <head>\n' +
' //header\n' + ' //header\n' +
@@ -133,8 +133,8 @@ it('should replace the all ":storage" path with the actual storage path', functi
' </p>\n' + ' </p>\n' +
' </body>\n' + ' </body>\n' +
'</html>' '</html>'
let storagePath = '<<dummyStoragePath>>' const storagePath = '<<dummyStoragePath>>'
let expectedOutput = const expectedOutput =
'<html>\n' + '<html>\n' +
' <head>\n' + ' <head>\n' +
' //header\n' + ' //header\n' +
@@ -152,17 +152,17 @@ it('should replace the all ":storage" path with the actual storage path', functi
' </p>\n' + ' </p>\n' +
' </body>\n' + ' </body>\n' +
'</html>' '</html>'
let actual = systemUnderTest.fixLocalURLS(testInput, storagePath) const actual = systemUnderTest.fixLocalURLS(testInput, storagePath)
expect(actual).toEqual(expectedOutput) expect(actual).toEqual(expectedOutput)
}) })
it('should test that generateAttachmentMarkdown works correct both with previews and without', function () { it('should test that generateAttachmentMarkdown works correct both with previews and without', function () {
let fileName = 'fileName' const fileName = 'fileName'
let path = 'path' const path = 'path'
let expected = `![${fileName}](${path})` let expected = `![${fileName}](${path})`
let actual = systemUnderTest.generateAttachmentMarkdown(fileName, path, true) let actual = systemUnderTest.generateAttachmentMarkdown(fileName, path, true)
expect(actual).toEqual(expected) expect(actual).toEqual(expected)
expected = `[${fileName}](${path})` expected = `[${fileName}](${path})`
actual = systemUnderTest.generateAttachmentMarkdown(fileName, path, false) actual = systemUnderTest.generateAttachmentMarkdown(fileName, path, false)
expect(actual).toEqual(expected) expect(actual).toEqual(expected)
}) })