diff --git a/README.md b/README.md index c7bc199e..27fb806a 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Mark Text build for these platforms ![Conda](https://img.shields.io/conda/pn/con | ![]( 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) | | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | -| [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). diff --git a/src/editor/contentState/copyCutCtrl.js b/src/editor/contentState/copyCutCtrl.js index f2977dcb..0c687870 100644 --- a/src/editor/contentState/copyCutCtrl.js +++ b/src/editor/contentState/copyCutCtrl.js @@ -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) => { diff --git a/src/editor/contentState/pasteCtrl.js b/src/editor/contentState/pasteCtrl.js index 4b5fce50..c8fce159 100644 --- a/src/editor/contentState/pasteCtrl.js +++ b/src/editor/contentState/pasteCtrl.js @@ -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 diff --git a/src/editor/index.js b/src/editor/index.js index 4bc90496..4df331fe 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -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') } } } diff --git a/src/editor/utils/importMarkdown.js b/src/editor/utils/importMarkdown.js index 33092322..347a899a 100644 --- a/src/editor/utils/importMarkdown.js +++ b/src/editor/utils/importMarkdown.js @@ -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) }