Modified superscript and subscript text styles to be mutually exclusive.#20116
Modified superscript and subscript text styles to be mutually exclusive.#20116martnpaneq wants to merge 10 commits into
superscript and subscript text styles to be mutually exclusive.#20116Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 44ef9f6. Configure here.
|
Edge case, but what would happen when both the subscript and superscript attributes are defined in the data on the editor load? <p>
Test: <sup><sub>2</sub></sup>.
</p>I am wondering about the alternative approach: Use a schema to control both attributes. This way, we do not have to provide additional configuration options. Instead, our docs can share a code snippet that would turn off this check. By adding a postfixer, this approach resolves the potential issue with invalid HTML when creating the editor. One caveat: we need to decide which attribute is more important. For the following conflict:
Maybe we can solve it at the upcast level, but I am not sure. |

🚀 Summary
The
superscriptandsubscripttext styles are now mutually exclusive: applying one to text that already has the other replaces it, matching the behavior of common word processors. The previous behavior, where both attributes could coexist on the same text, can be restored by settingconfig.basicStyles.superscript.allowNestingorconfig.basicStyles.subscript.allowNestingtotrue, which is useful for content such as isotope notation or tensor indices.📌 Related issues
💡 Additional information
Screen.Recording.2026-04-28.at.12.31.35.mov
🧾 Checklists
Use the following checklists to ensure important areas were not overlooked.
This does not apply to feature-branch merges.
If an item is not relevant to this type of change, simply leave it unchecked.
Author checklist
superscriptandsubscriptto be aligned with other solutions on the market.)Reviewer checklist
t()(if any).