(event: KeyboardEvent)
| 346 | } |
| 347 | |
| 348 | function legacyNewLineFix(event: KeyboardEvent) { |
| 349 | // Firefox does not support plaintext-only mode |
| 350 | // and puts <div><br></div> on Enter. Let's help. |
| 351 | if (isLegacy && event.key === 'Enter') { |
| 352 | preventDefault(event) |
| 353 | event.stopPropagation() |
| 354 | if (afterCursor() == '') { |
| 355 | insert('\n ') |
| 356 | const pos = save() |
| 357 | pos.start = --pos.end |
| 358 | restore(pos) |
| 359 | } else { |
| 360 | insert('\n') |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | function handleSelfClosingCharacters(event: KeyboardEvent) { |
| 366 | const open = options.autoclose.open; |
no test coverage detected