Skip to content

feat(text-editor): add highlight, subscript, superscript and mathematics toolbar actions#10627

Open
ComputerCrack wants to merge 5 commits intohcengineering:developfrom
ComputerCrack:feat/text-editor-actions
Open

feat(text-editor): add highlight, subscript, superscript and mathematics toolbar actions#10627
ComputerCrack wants to merge 5 commits intohcengineering:developfrom
ComputerCrack:feat/text-editor-actions

Conversation

@ComputerCrack
Copy link

@ComputerCrack ComputerCrack commented Mar 12, 2026

Adds four text formatting actions to the editor toolbar.

Highlight (@tiptap/extension-highlight)

  • The extension was already part of the editor kit but had no toolbar button or command wired up; this simply exposes the existing functionality
  • Toggles background highlight on selected text (single color mode)

Subscript / Superscript (@tiptap/extension-subscript, @tiptap/extension-superscript)

  • Replaced hand-coded inconsistent SVG icons with Material Design Icons (Apache 2.0, 24×24) for visual consistency with the rest of the toolbar
  • Fixed toolbar order — subscript and superscript are now grouped together instead of being separated by the text color button

Mathematics (@tiptap/extension-mathematics + KaTeX)

  • Inline math via $...$ and block math via $$...$$
  • Custom rendering plugin replaces the upstream library implementation to support multi-line math expressions (Shift+Enter / hardBreak within a single paragraph)
  • Toggle behavior: wraps selection or inserts placeholder; pressing the button again unwraps
  • Active state detection for both inline and block variants
  • Math expressions inside code blocks are intentionally not rendered
  • LaTeX paste handling: pasted text containing $...$ or $$...$$ is inserted as plain text, preserving the math delimiters

All actions include active state detection (button highlights when formatting is active at cursor position).

Note on pre-existing issues

The following ESLint (strict-boolean-expressions) errors exist on develop and are unrelated to this PR:

  • plugins/text-editor-resources/src/components/extension/emoji.ts
  • plugins/text-editor-resources/src/components/extension/reference.ts
  • plugins/text-editor-resources/src/components/table/refreshTable.ts

@huly-github-staging
Copy link

Connected to Huly®: UBERF-15853

@ComputerCrack ComputerCrack changed the title feat(text-editor): add highlight, subscript and superscript toolbar actions feat(text-editor): add highlight, subscript, superscript and mathematics toolbar actions Mar 12, 2026
ComputerCrack added 5 commits March 12, 2026 18:34
Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>
Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>
Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>
Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>
…s extension

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>
@ComputerCrack ComputerCrack force-pushed the feat/text-editor-actions branch from 46c8f66 to 457a107 Compare March 12, 2026 17:35
@ComputerCrack
Copy link
Author

@aonnikov @BykhovDenis @ArtyomSavchenko Requesting manual review

@ArtyomSavchenko
Copy link
Member

ArtyomSavchenko commented Mar 14, 2026

Hi @ComputerCrack,
Thanks for your contribution.
The validation build step failed with the following errors:

Error: /home/runner/work/platform/platform/plugins/text-editor-resources/src/kits/editor-kit.ts(83,7): error TS2742: The inferred type of 'StaticEditorKit' cannot be named without a reference to '../../../../foundations/core/packages/text/node_modules/@tiptap/extension-subscript/dist'. This is likely not portable. A type annotation is necessary.
Error: /home/runner/work/platform/platform/plugins/text-editor-resources/src/kits/editor-kit.ts(83,7): error TS2742: The inferred type of 'StaticEditorKit' cannot be named without a reference to '../../../../foundations/core/packages/text/node_modules/@tiptap/extension-superscript/dist'. This is likely not portable. A type annotation is necessary.

Could you please take a look?
For local verification, you can run rush validate to validate all packages, or rushx validate from the package folder to validate one package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants