Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jan 27, 2025

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.

None yet

2 participants