]> BookStack Code Mirror - bookstack/commit
Lexical: Fixed strange paragraph formatting behaviour
authorDan Brown <redacted>
Fri, 13 Jun 2025 18:40:13 +0000 (19:40 +0100)
committerDan Brown <redacted>
Fri, 13 Jun 2025 18:40:13 +0000 (19:40 +0100)
commit8b062d47951825e04f9a65ea3b09d9c70ee8b59d
tree1f52dbd50fd302389aee5aae44d4aaa14e1c8c0c
parent717b5163414124422899d4270e41db4267e316c9
Lexical: Fixed strange paragraph formatting behaviour

Formatting was not persisted on empty paragraphs, and was instead based
upon last format encountered in selection.
This was due to overly-hasty removal of other formatting code, which
this got caught it.
Restored required parts from prior codebase.

Also updated inline format button active indicator to reflect formats
using the above, so correct buttons are shown as active even when just
in an empty paragraph.
resources/js/wysiwyg/index.ts
resources/js/wysiwyg/lexical/core/LexicalEvents.ts
resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts
resources/js/wysiwyg/utils/selection.ts