]> BookStack Code Mirror - bookstack/commit
WYSIWG: Improved handling of cross-block code block creation
authorDan Brown <redacted>
Sun, 6 Feb 2022 15:14:57 +0000 (15:14 +0000)
committerDan Brown <redacted>
Sun, 6 Feb 2022 15:19:18 +0000 (15:19 +0000)
commitb2f863e1f18ab9997dc43178ef53bc04b849e10c
tree493fe54bab4b4169f6648691bd6478ca1721e1c9
parent049d6ba5b2e16041664de644980e34cdeed3738c
WYSIWG: Improved handling of cross-block code block creation

- Updated code content to get specific text selection instead of using
  node-based handling which could return the whole document when
  multiple top-level nodes were in selection.
- Simplified how code gets applied into the page to not be node based
  but use native editor methods to replace the selection. Allows
  creation from half-way through a block.

Tested on chrome+Firefox on Fedora 35.
Builds upon changes in #3246.
For #3200.
resources/js/components/wysiwyg-editor.js