-
-
Notifications
You must be signed in to change notification settings - Fork 543
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
XWIKI-17218: Text in a table cell gets scrambled when cancelling the add annotation form #3204
base: master
Are you sure you want to change the base?
Conversation
...latform-annotation/xwiki-platform-annotation-ui/src/main/resources/AnnotationCode/Script.xml
Outdated
Show resolved
Hide resolved
…add annotation form
…add annotation form
// We used previously replace for prototype, but it behaves badly when the parent of the wrapper is a td. | ||
// Also, wrapper is always an element containing only text. In otherword, if <strong>a<em>b</em>c</strong> is | ||
// selected for annotation, a, b, and c will each be wrapped in a <span class='selection-highligh' ...>. | ||
// Therefore, when unwrapping we know that the spans of this.highlightWrappers contain only text. |
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.
I think this comment about text nodes isn't needed anymore now that the code uses childNodes
as they preserve everything including HTML elements.
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.
Yes, still interesting to understand what's going on here, but it's not really useful to understand the method anymore.
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.
So you suggest leaving the comment unmodified? I find it a bit strange to highlight the fact that we only have text nodes several times even though the code would work perfectly fine if there were also other nodes. I'm not against having some comment, I have just the feeling it doesn't fully fit with the code below.
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.
No I'll remove the comment, but I'm lagging behind, I'll make the PR a draft until I clean that up.
Jira URL
https://jira.xwiki.org/browse/XWIKI-17218
Changes
Description
Executed Tests
Expected merging strategy