Skip to content

Commit

Permalink
fix guardrails errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Jan 29, 2019
1 parent a85a27f commit b1c6c04
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions browser/components/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,10 +888,7 @@ export default class CodeEditor extends React.Component {
handlePaste (editor, forceSmartPaste) {
const { storageKey, noteKey, fetchUrlTitle, enableSmartPaste } = this.props

const isURL = str => {
const matcher = /^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/
return matcher.test(str)
}
const isURL = str => /(?:^\w+:|^)\/\/(?:[^\s\.]+\.\S{2}|localhost[\:?\d]*)/.test(str)

const isInLinkTag = editor => {
const startCursor = editor.getCursor('start')
Expand Down Expand Up @@ -1109,7 +1106,7 @@ export default class CodeEditor extends React.Component {
iconv.encodingExists(_charset)
? _charset
: 'utf-8'
resolve(iconv.decode(new Buffer(buff), charset).toString())
resolve(iconv.decode(Buffer.from(buff), charset).toString())
} catch (e) {
reject(e)
}
Expand Down

0 comments on commit b1c6c04

Please sign in to comment.