Skip to content

Commit

Permalink
🎨 Vanessa219#27 placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 authored and stevapple committed Apr 8, 2020
1 parent 980e41a commit abceaf2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@

* [open issues](https://github.com/Vanessa219/vditor/issues)

### v3.0.3 / 未发布
### v3.0.4 / 未发布

* [27](https://github.com/Vanessa219/vditor/issues/27) 支持类似 Typora 的及时渲染模式 `引入特性`

### v3.0.3 / 2020-03-20

* [229](https://github.com/Vanessa219/vditor/issues/229) 初始化时不应该自动获取焦点 `改进功能`
* [228](https://github.com/Vanessa219/vditor/pull/228) menu misplaced when vditor is not first child `改进功能`
* [227](https://github.com/Vanessa219/vditor/pull/227) add jsdoc `引入特性`

### v3.0.2 / 2020-03-19

* [225](https://github.com/Vanessa219/vditor/pull/225) publish type declaration file `引入特性`
* [224](https://github.com/Vanessa219/vditor/issues/224) md2html 方法报错 `修复缺陷`
* [223](https://github.com/Vanessa219/vditor/issues/223) 下列 a 前输入 ``` b 会消失,且返回无光标 `修复缺陷`
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vditor",
"version": "3.0.2",
"version": "3.0.3",
"description": "♏ 一款浏览器端的 Markdown 编辑器。",
"author": "Vanessa <v@b3log.org> (http://vanessa.b3log.org)",
"homepage": "https://hacpai.com/tag/vditor",
Expand Down
6 changes: 3 additions & 3 deletions src/js/lute/lute.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/ts/ir/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ class IR {
if (event.isComposing || isCtrl(event)) {
return;
}
if ((event.key === "Backspace" || event.key === "Delete") &&
vditor.ir.element.innerHTML !== "" && vditor.ir.element.childNodes.length === 1 &&
vditor.ir.element.firstElementChild && vditor.ir.element.firstElementChild.tagName === "P"
&& (vditor.ir.element.textContent === "" || vditor.ir.element.textContent === "\n")) {
// 为空时显示 placeholder
vditor.ir.element.innerHTML = "";
return;
}
if (event.key.indexOf("Arrow") > -1) {
expandMarker(getSelection().getRangeAt(0), vditor);
}
Expand Down

0 comments on commit abceaf2

Please sign in to comment.