Commit 2d060d5 1 parent bac1b1e commit 2d060d5 Copy full SHA for 2d060d5
File tree 6 files changed +19
-17
lines changed
6 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -182,21 +182,19 @@ export default {
182
182
// type -> 'emoji' / 'image'
183
183
type : 'emoji' ,
184
184
// content -> 数组
185
- content :
186
- '😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣' . split (
187
- / \s /
188
- ) ,
185
+ content : '😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣' . split (
186
+ / \s /
187
+ ) ,
189
188
} ,
190
189
{
191
190
// tab 的标题
192
191
title : '手势' ,
193
192
// type -> 'emoji' / 'image'
194
193
type : 'emoji' ,
195
194
// content -> 数组
196
- content :
197
- '👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏' . split (
198
- / \s /
199
- ) ,
195
+ content : '👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏' . split (
196
+ / \s /
197
+ ) ,
200
198
} ,
201
199
] ,
202
200
Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ SimpleHtmlParser.prototype = {
61
61
62
62
// regexps
63
63
64
- startTagRe :
65
- / ^ < ( [ ^ > \s \/ ] + ) ( ( \s + [ ^ = > \s ] + ( \s * = \s * ( ( \" [ ^ " ] * \" ) | ( \' [ ^ ' ] * \' ) | [ ^ > \s ] + ) ) ? ) * ) \s * \/ ? \s * > / m,
64
+ startTagRe : / ^ < ( [ ^ > \s \/ ] + ) ( ( \s + [ ^ = > \s ] + ( \s * = \s * ( ( \" [ ^ " ] * \" ) | ( \' [ ^ ' ] * \' ) | [ ^ > \s ] + ) ) ? ) * ) \s * \/ ? \s * > / m,
66
65
endTagRe : / ^ < \/ ( [ ^ > \s ] + ) [ ^ > ] * > / m,
67
66
attrRe : / ( [ ^ = \s ] + ) ( \s * = \s * ( ( \" ( [ ^ " ] * ) \" ) | ( \' ( [ ^ ' ] * ) \' ) | [ ^ > \s ] + ) ) ? / gm,
68
67
Original file line number Diff line number Diff line change @@ -51,5 +51,13 @@ export default function bindEventKeyboardEvent(editor: Editor) {
51
51
lastChildNodeInPrevNode =
52
52
lastChildNodeInPrevNode . childNodes [ lastChildNodeInPrevNode . childNodes . length - 1 ]
53
53
}
54
+
55
+ if (
56
+ lastChildNodeInPrevNode instanceof HTMLElement &&
57
+ lastChildNodeInPrevNode . tagName === 'IMG'
58
+ ) {
59
+ lastChildNodeInPrevNode . remove ( )
60
+ e . preventDefault ( )
61
+ }
54
62
} )
55
63
}
Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ class LineHeight extends DropListMenu implements MenuActive {
69
69
//获取range 开头结束的dom
70
70
const StartElem : DomElement = $ ( editor . selection . getSelectionStartElem ( ) )
71
71
const EndElem : DomElement = $ ( editor . selection . getSelectionEndElem ( ) )
72
- const childList : NodeListOf < ChildNode > | undefined =
73
- editor . selection . getRange ( ) ?. commonAncestorContainer . childNodes
72
+ const childList : NodeListOf < ChildNode > | undefined = editor . selection . getRange ( )
73
+ ?. commonAncestorContainer . childNodes
74
74
arrayDom_a . push ( this . getDom ( StartElem . elems [ 0 ] ) )
75
75
childList ?. forEach ( ( item , index ) => {
76
76
if ( item === this . getDom ( StartElem . elems [ 0 ] ) ) {
Original file line number Diff line number Diff line change @@ -343,9 +343,7 @@ class Text {
343
343
// 键盘 down 时的 hooks
344
344
$textElem . on ( 'keydown' , ( e : KeyboardEvent ) => {
345
345
const keydownEvents = eventHooks . keydownEvents
346
- setTimeout ( ( ) => {
347
- keydownEvents . forEach ( fn => fn ( e ) )
348
- } )
346
+ keydownEvents . forEach ( fn => fn ( e ) )
349
347
} )
350
348
351
349
// delete 键 up 时 hooks
Original file line number Diff line number Diff line change 6
6
export function EMPTY_FN ( ) { }
7
7
8
8
//用于校验是否为url格式字符串
9
- export const urlRegex =
10
- / ^ ( h t t p | f t p | h t t p s ) : \/ \/ [ \w \- _ ] + ( \. [ \w \- _ ] + ) + ( [ \w \- . , @ ? ^ = % & a m p ; : / ~ + # ] * [ \w \- @ ? ^ = % & a m p ; / ~ + # ] ) ? /
9
+ export const urlRegex = / ^ ( h t t p | f t p | h t t p s ) : \/ \/ [ \w \- _ ] + ( \. [ \w \- _ ] + ) + ( [ \w \- . , @ ? ^ = % & a m p ; : / ~ + # ] * [ \w \- @ ? ^ = % & a m p ; / ~ + # ] ) ? /
11
10
12
11
// 编辑器为了方便继续输入/换行等原因 主动生成的空标签
13
12
export const EMPTY_P = '<p data-we-empty-p=""><br></p>'
You can’t perform that action at this time.
0 commit comments