Skip to content

Feature: Code Editor modal, adds pretty-print support#18123

Merged
leekelleher merged 4 commits intov15/devfrom
v15/feature/code-editor-modal-prettyprint
Jan 27, 2025
Merged

Feature: Code Editor modal, adds pretty-print support#18123
leekelleher merged 4 commits intov15/devfrom
v15/feature/code-editor-modal-prettyprint

Conversation

@leekelleher
Copy link
Member

Description

Adds formatOnLoad option to the Code Editor modal configuration.

When enabled, once the Monaco editor has loaded, the 'editor.action.formatDocument' action is ran against it to pretty-print the code contents. Currently, this only seems to work when using setTimeout to delay the action execution.

How to test?

Load up a Tiptap RTE, (the more content the better, e.g. more than a couple of paragraphs), press the "View Source Code" toolbar button. See the Code Editor modal opens and that the code contents is formatted, (e.g. on multiple lines, not on a single line).

@leekelleher leekelleher merged commit 8f212ae into v15/dev Jan 27, 2025
30 checks passed
@leekelleher leekelleher deleted the v15/feature/code-editor-modal-prettyprint branch January 27, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants