mirror of
https://github.com/marktext/marktext.git
synced 2025-05-19 02:10:34 +08:00
Bugfix: Can not select emoji
This commit is contained in:
parent
13f4164b32
commit
efe58c7835
@ -120,7 +120,7 @@ Mark Text build for these platforms  |  |  |
|
||||
| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
|
||||
| [latest version](https://github.com/marktext/marktext/releases/download/v0.8.12/marktext-0.8.12.dmg) | [latest version](https://github.com/marktext/marktext/releases/download/v0.8.12/marktext-setup-0.8.12.exe) | [latest version](https://github.com/marktext/marktext/releases/download/v0.8.12/marktext-0.8.12-x86_64.AppImage) |
|
||||
| [latest version](https://github.com/marktext/marktext/releases/download/v0.9.25/marktext-0.9.25.dmg) | [latest version](https://github.com/marktext/marktext/releases/download/v0.9.25/marktext-setup-0.9.25.exe) | [latest version](https://github.com/marktext/marktext/releases/download/v0.9.25/marktext-0.9.25-x86_64.AppImage) |
|
||||
|
||||
Did not found your system ? Go the the [release page](https://github.com/marktext/marktext/releases). Still not found ? Shoot an [issue](https://github.com/marktext/marktext/issues).
|
||||
|
||||
|
@ -61,16 +61,6 @@ const copyCutCtrl = ContentState => {
|
||||
})
|
||||
}
|
||||
|
||||
// const mathText = $(`.${CLASS_OR_ID['AG_MATH']} span`)
|
||||
// if (mathText.length > 0) {
|
||||
// mathText.each((i, m) => {
|
||||
// const ele = $(m)
|
||||
// console.log(ele.text())
|
||||
|
||||
// ele.text(ele.text().replace(/\\/g, ''))
|
||||
// })
|
||||
// }
|
||||
|
||||
const codefense = $(`pre.${CLASS_OR_ID['AG_CODE_BLOCK']}`)
|
||||
if (codefense.length > 0) {
|
||||
codefense.each((i, cf) => {
|
||||
|
@ -35,6 +35,7 @@ const pasteCtrl = ContentState => {
|
||||
}
|
||||
|
||||
const stateFragments = this.html2State(html)
|
||||
|
||||
if (stateFragments.length <= 0) return
|
||||
// step 1: if select content, cut the content, and chop the block text into two part by the cursor.
|
||||
const { start, end } = this.cursor
|
||||
|
@ -147,7 +147,7 @@ class Aganippe {
|
||||
const { left, top } = emojiNode.getBoundingClientRect()
|
||||
const cb = item => {
|
||||
setInlineEmoji(emojiNode, item, selection)
|
||||
this.floatBox.hideIfNeeded(['emojis'])
|
||||
this.floatBox.hideIfNeeded(['emoji'])
|
||||
}
|
||||
if (list.length) {
|
||||
this.floatBox.showIfNeeded({
|
||||
@ -155,7 +155,7 @@ class Aganippe {
|
||||
}, 'emoji', cb)
|
||||
this.floatBox.setOptions(list)
|
||||
} else {
|
||||
this.floatBox.hideIfNeeded('emojis')
|
||||
this.floatBox.hideIfNeeded('emoji')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +222,8 @@ const importRegister = ContentState => {
|
||||
}
|
||||
// transform `paste's text/html data` to content state blocks.
|
||||
ContentState.prototype.html2State = function (html) {
|
||||
const markdown = turndownService.turndown(html)
|
||||
// remove double `\\` in Math but I dont know why there are two '\' when paste. @jocs
|
||||
const markdown = turndownService.turndown(html).replace(/(\\)\\/g, '$1')
|
||||
return this.getStateFragment(markdown)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user