-
Notifications
You must be signed in to change notification settings - Fork 91
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
Fix/2708 pasting tables #4285
Fix/2708 pasting tables #4285
Conversation
0e083c4
to
749ac53
Compare
2 flaky tests on run #10263 ↗︎
Details:
nodes/HardBreak.spec.js • 1 flaky test
api/UsersApi.spec.js • 1 flaky test
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
src/tests/markdown.spec.js
Outdated
markdownThroughEditor, | ||
markdownThroughEditorHtml, | ||
markdownFromPaste | ||
} from "./helpers"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking, but this probably needs adjustments to please the linter (single quotes, no semicolon).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Linter is not complaining though... funny.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I didn't test it yet, but the code changes look reasonable to me. Also learned about the :first-of-type
CSS selector. And awesome that you extended the test matrix to cover the fixed issue 🎉
Probably we should backport this all the way back to stable25. |
/backport to stable27 |
/backport to stable26 |
/backport to stable25 |
@@ -37,7 +39,7 @@ export default { | |||
renderHtml(content) { | |||
return '<pre>' + escapeHtml(content) + '</pre>' | |||
}, | |||
extensions: () => [PlainText], | |||
extensions: () => [PlainText, CodeBlock], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change related or shouldn't this be a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point... I'll split!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good just a comment about if the code block change is related or rather something for a separate PR.
Signed-off-by: Max <[email protected]>
Fixes #2708. Try to read the first table row as headings. Pasting works via `insertContent` while opening uses `setContent`. They use the schema in different ways. So we also need to make sure to test both for some corner cases. `setContent` is fairly flexible in turning the input into a valid document structure. `insertContent` however fails to resolve structures that would require picking lower priority parent elements. Note: Some tests in src/tests/nodes/Table.spec.js fail when using `insertContent` instead of `setContent`. Pasting the correponding html table is fixed never the less. Signed-off-by: Max <[email protected]>
749ac53
to
92a3dcf
Compare
/compile |
Signed-off-by: nextcloud-command <[email protected]>
The backport to stable27 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable27
git pull origin stable27
# Create the new backport branch
git checkout -b fix/foo-stable27
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable26 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable26
git pull origin stable26
# Create the new backport branch
git checkout -b fix/foo-stable26
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable25 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable25
git pull origin stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
/backport 69d5889,92a3dcf9eddf616b92c203c1843500624faa9b93 to stable27 |
/backport 69d5889,92a3dcf9eddf616b92c203c1843500624faa9b93 to stable26 |
/backport 92a3dcf to stable25 |
The backport to stable25 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable25
git pull origin stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
Manual backport to stable25: #4326 |
📝 Summary
Fixes #2708.
Try to read the first table row as headings.
Pasting works via
insertContent
while opening usessetContent
.They use the schema in different ways.
So we also need to make sure to test both for some corner cases.
setContent
is fairly flexible in turning the inputinto a valid document structure.
insertContent
however fails to resolve structuresthat would require picking lower priority parent elements.
Note: Some tests in src/tests/nodes/Table.spec.js
fail when using
insertContent
instead ofsetContent
.Pasting the correponding html table is fixed never the less.
🏁 Checklist
npm run lint
/npm run stylelint
/composer run cs:check
)