mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
@@ -866,7 +866,13 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.handlePasteText(editor, pastedTxt)
|
this.handlePasteText(editor, pastedTxt)
|
||||||
} else if (fetchUrlTitle && isURL(pastedTxt) && !isInLinkTag(editor)) {
|
} else if (fetchUrlTitle && isURL(pastedTxt) && !isInLinkTag(editor)) {
|
||||||
this.handlePasteUrl(editor, pastedTxt)
|
this.handlePasteUrl(editor, pastedTxt)
|
||||||
} else if (enableSmartPaste || forceSmartPaste) {
|
} else if (attachmentManagement.isAttachmentLink(pastedTxt)) {
|
||||||
|
attachmentManagement
|
||||||
|
.handleAttachmentLinkPaste(storageKey, noteKey, pastedTxt)
|
||||||
|
.then(modifiedText => {
|
||||||
|
this.editor.replaceSelection(modifiedText)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
const image = clipboard.readImage()
|
const image = clipboard.readImage()
|
||||||
if (!image.isEmpty()) {
|
if (!image.isEmpty()) {
|
||||||
attachmentManagement.handlePastNativeImage(
|
attachmentManagement.handlePastNativeImage(
|
||||||
@@ -875,22 +881,16 @@ export default class CodeEditor extends React.Component {
|
|||||||
noteKey,
|
noteKey,
|
||||||
image
|
image
|
||||||
)
|
)
|
||||||
} else {
|
} else if (enableSmartPaste || forceSmartPaste) {
|
||||||
const pastedHtml = clipboard.readHTML()
|
const pastedHtml = clipboard.readHTML()
|
||||||
if (pastedHtml.length > 0) {
|
if (pastedHtml.length > 0) {
|
||||||
this.handlePasteHtml(editor, pastedHtml)
|
this.handlePasteHtml(editor, pastedHtml)
|
||||||
} else {
|
} else {
|
||||||
this.handlePasteText(editor, pastedTxt)
|
this.handlePasteText(editor, pastedTxt)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.handlePasteText(editor, pastedTxt)
|
||||||
}
|
}
|
||||||
} else if (attachmentManagement.isAttachmentLink(pastedTxt)) {
|
|
||||||
attachmentManagement
|
|
||||||
.handleAttachmentLinkPaste(storageKey, noteKey, pastedTxt)
|
|
||||||
.then(modifiedText => {
|
|
||||||
this.editor.replaceSelection(modifiedText)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.handlePasteText(editor, pastedTxt)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class HotkeyTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>{i18n.__('Paste Smartly')}</div>
|
<div styleName='group-section-label'>{i18n.__('Paste HTML')}</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
onChange={(e) => this.handleHotkeyChange(e)}
|
onChange={(e) => this.handleHotkeyChange(e)}
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ class UiTab extends React.Component {
|
|||||||
ref='enableSmartPaste'
|
ref='enableSmartPaste'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
{i18n.__('Enable smart paste')}
|
{i18n.__('Enable HTML paste')}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user