File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -888,10 +888,7 @@ export default class CodeEditor extends React.Component {
888
888
handlePaste ( editor , forceSmartPaste ) {
889
889
const { storageKey, noteKey, fetchUrlTitle, enableSmartPaste } = this . props
890
890
891
- const isURL = str => {
892
- const matcher = / ^ (?: \w + : ) ? \/ \/ ( [ ^ \s \. ] + \. \S { 2 } | l o c a l h o s t [ \: ? \d ] * ) \S * $ /
893
- return matcher . test ( str )
894
- }
891
+ const isURL = str => / (?: ^ \w + : | ^ ) \/ \/ (?: [ ^ \s \. ] + \. \S { 2 } | l o c a l h o s t [ \: ? \d ] * ) / . test ( str )
895
892
896
893
const isInLinkTag = editor => {
897
894
const startCursor = editor . getCursor ( 'start' )
@@ -1109,7 +1106,7 @@ export default class CodeEditor extends React.Component {
1109
1106
iconv . encodingExists ( _charset )
1110
1107
? _charset
1111
1108
: 'utf-8'
1112
- resolve ( iconv . decode ( new Buffer ( buff ) , charset ) . toString ( ) )
1109
+ resolve ( iconv . decode ( Buffer . from ( buff ) , charset ) . toString ( ) )
1113
1110
} catch ( e ) {
1114
1111
reject ( e )
1115
1112
}
You can’t perform that action at this time.
0 commit comments