Skip to content

Commit efe58c7

Browse files
committed
Bugfix: Can not select emoji
1 parent 13f4164 commit efe58c7

5 files changed

Lines changed: 6 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Mark Text build for these platforms ![Conda](https://img.shields.io/conda/pn/con
120120

121121
| ![]( https://github.com/ryanoasis/nerd-fonts/wiki/screenshots/v1.0.x/mac-pass-sm.png) | ![]( https://github.com/ryanoasis/nerd-fonts/wiki/screenshots/v1.0.x/windows-pass-sm.png) | ![]( https://github.com/ryanoasis/nerd-fonts/wiki/screenshots/v1.0.x/linux-pass-sm.png) |
122122
| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
123-
| [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) |
123+
| [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) |
124124

125125
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).
126126

src/editor/contentState/copyCutCtrl.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ const copyCutCtrl = ContentState => {
6161
})
6262
}
6363

64-
// const mathText = $(`.${CLASS_OR_ID['AG_MATH']} span`)
65-
// if (mathText.length > 0) {
66-
// mathText.each((i, m) => {
67-
// const ele = $(m)
68-
// console.log(ele.text())
69-
70-
// ele.text(ele.text().replace(/\\/g, ''))
71-
// })
72-
// }
73-
7464
const codefense = $(`pre.${CLASS_OR_ID['AG_CODE_BLOCK']}`)
7565
if (codefense.length > 0) {
7666
codefense.each((i, cf) => {

src/editor/contentState/pasteCtrl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const pasteCtrl = ContentState => {
3535
}
3636

3737
const stateFragments = this.html2State(html)
38+
3839
if (stateFragments.length <= 0) return
3940
// step 1: if select content, cut the content, and chop the block text into two part by the cursor.
4041
const { start, end } = this.cursor

src/editor/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ class Aganippe {
147147
const { left, top } = emojiNode.getBoundingClientRect()
148148
const cb = item => {
149149
setInlineEmoji(emojiNode, item, selection)
150-
this.floatBox.hideIfNeeded(['emojis'])
150+
this.floatBox.hideIfNeeded(['emoji'])
151151
}
152152
if (list.length) {
153153
this.floatBox.showIfNeeded({
154154
left, top
155155
}, 'emoji', cb)
156156
this.floatBox.setOptions(list)
157157
} else {
158-
this.floatBox.hideIfNeeded('emojis')
158+
this.floatBox.hideIfNeeded('emoji')
159159
}
160160
}
161161
}

src/editor/utils/importMarkdown.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ const importRegister = ContentState => {
222222
}
223223
// transform `paste's text/html data` to content state blocks.
224224
ContentState.prototype.html2State = function (html) {
225-
const markdown = turndownService.turndown(html)
225+
// remove double `\\` in Math but I dont know why there are two '\' when paste. @jocs
226+
const markdown = turndownService.turndown(html).replace(/(\\)\\/g, '$1')
226227
return this.getStateFragment(markdown)
227228
}
228229

0 commit comments

Comments
 (0)