Fix disappearing letters and words from lists pasted from Word#6690
Closed
aautio wants to merge 1 commit intotinymce:developfrom
Closed
Fix disappearing letters and words from lists pasted from Word#6690aautio wants to merge 1 commit intotinymce:developfrom
aautio wants to merge 1 commit intotinymce:developfrom
Conversation
Fixes tinymce#2810, Fixes tinymce#3017, Fixes tinymce#3480, Fixes tinymce#5474 This commit includes fixes to multiple subtle errors in MS Word list cleanups. The bugs caused any characters ending with a dot to disappear from the lists under certain circumstances: Font/style -changes cause multiple text nodes to appear as siblings in the AST. Function filterStyles marked only the first node with _listIgnore and thus missed the nodes with roman numerals. This was fixed. The removeIgnoredNodes-function used node.remove() to delete nodes from the AST. The method sets node.next to null and thus recursion did not proceed further. Sibling text nodes with _listIgnore would not be deleted. This was fixed by avoiding node.remove(). The trimListStart -function did not trim the beginning of the paragraph. It trimmed all text nodes instead and removed the ones with words ending with dot. This was fixed by mering the paragraph text nodes before trimming the first text node. Regex for cleaning up the beginning is now safe. It no longer removes any letters (with \w). Instead it only looks for certain bullets. One regex is enough to filter those as the text nodes have been merged before matching. Added a couple of test cases as a proof that the fixes work correctly.
2 tasks
Contributor
|
Hey @aautio, apologies for not updating you regarding this PR in a while. We want to merge it, but we've noticed there's a potential breaking change in your changes. As such we also want to do some testing and other work on our side first. We had hoped to fit this in the TinyMCE 5.9 release, but that is looking unlikely. So, unfortunately, I'm going to remove this from the 5.9 milestone and we'll reschedule it for another future release. |
Member
|
Closing as discussed via email - I've opened the topic to search for a community maintainer at #7487. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request replaces #6621 as agreed with @JamesToohey.
Fixes #2810, Fixes #3017, Fixes #3480, Fixes #5474
This commit includes fixes to multiple subtle errors in MS Word list
cleanups. The bugs caused any characters ending with a dot to disappear
from the lists under certain circumstances:
Font/style -changes cause multiple text nodes to appear as siblings in
the AST.
Function
filterStylesmarked only the first node with_listIgnoreandthus missed the nodes with roman numerals. This was fixed.
The
removeIgnoredNodes-function usednode.remove()to delete nodesfrom the AST. The method sets
node.nexttonulland thus recursiondid not proceed further. Sibling text nodes with
_listIgnorewouldnot be deleted. This was fixed by avoiding
node.remove().The
trimListStart-function did not trim the beginning of theparagraph. It trimmed all text nodes instead and removed the ones with
words ending with dot. This was fixed by merging the paragraph
text nodes before trimming the first text node.
Regex for cleaning up the beginning is now safe. It no longer removes
any letters (with
\w). Instead it only looks for bullets. Oneregex is enough to filter those as the text nodes have been merged
before matching.
Added a couple of test cases as a proof that the fixes work correctly.
Pre-checks:
Review:
GitHub issues (if applicable):