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

Identify nestedElement fields even if their content expression is overridden #370

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

rhystmills
Copy link
Contributor

What does this change?

The workaround for the text element join after deleting a non-text element between two text elements relied on nestedElement fields having the content expression element+.

This is flawed, because the fields can have their content expression overridden - in fact we will need to override it to something like nonKeyTakeawaysElement+ in order to prevent a key takeaway element being pasted into another a key takeaway element.

This PR uses the stable "nested-element-field" group that should appear in nestedFields as an identifier for our workaround to use. In the long run we'll want to fix the route cause of the nestedElement fieldView update bug that caused the join issue, rather than relying on this workaround.

n.b. Groups are modelled in a string of space-separated group strings rather than as an array of strings.

How to test

If you're feeling diligent, use this version of prosemirror-elements locally in Composer via yalc.

Add text on either side of a pullquote and delete the pullquote. The document will appear invalid but will become valid on any mouse move.

@rhystmills rhystmills requested a review from a team as a code owner March 20, 2024 11:59
@rhystmills rhystmills merged commit 232897d into main Mar 20, 2024
3 checks passed
@rhystmills rhystmills deleted the rm/identify-nested-fields-better branch March 20, 2024 14:05
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