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

Migrate Scribe editor to ProseMirror #353

Merged
merged 6 commits into from Apr 30, 2024
Merged

Conversation

rhystmills
Copy link
Contributor

@rhystmills rhystmills commented Apr 26, 2024

What does this change?

This PR replaces our Scribe editor with ProseMirror, via @guardian/prosemirror-editor. Scribe is deprecated and contains vulnerabilities, so we want to replace it everywhere it exists. ProseMirror is the rich text editor we use in other tools (most notably flexible-content) so it makes sense to use it here too. This work has already been done for tagmanager and there's a PR open in targeting.

This removes the final (high priority) vulnerability from client-side atom-workshop: 🎉

image

atom-workshop has historically used <b> and <i> tags rather than the more semantically correct <strong> and <em> tags - I've preserved these (via transformToLegacyMarkup) for the sake of maintaining styles in consuming platforms.

The UX is slightly improved on the previous editor, introducing hover and disabled states for the buttons.

Before After
image image

What else does this change?

I found the setup script was failing on a step where brew tries to install openjdk8. As it happens this repo now uses Java 11 and advises using a package manage to install it, so I've removed that step.

(I also added a mention to the readme that other node package managers are available.)

How to test

  1. Run atom-workshop locally according to the instructions or deploy to CODE.
  2. Try editing or creating an atom which includes a Rich Text editor (e.g. Q and A, Guide, Profile, Timeline, Explainer)
  3. Does the editor work? Are changes persisted over save and load?

@rhystmills rhystmills changed the title Remove references to Scribe Migrate Scribe editor to ProseMirror Apr 26, 2024
Copy link

@simonbyford simonbyford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know anything about Scribe so may have missed some subtleties in the migration but the code looks good and everything appears to work okay. I tried editing/creating atoms and making sure the rich text fields are persisted correctly, all looks good.

Great work on tackling the last high-priority vulnerability! 🦾

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be renamed FormFieldRichTextEditor.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It absolutely should.
(Now done).

@rhystmills rhystmills merged commit 3d5705c into main Apr 30, 2024
1 check passed
@rhystmills rhystmills deleted the rm/migrate-scribe-editor branch April 30, 2024 10:08
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.

None yet

2 participants