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

Pasting a list into another list (fix list-style attr) #8354

Merged
merged 5 commits into from
Oct 28, 2020
Merged

Conversation

pomek
Copy link
Member

@pomek pomek commented Oct 27, 2020

#7959 # Suggested merge commit message (convention)

Fix (list): List styles will be inherited correctly when pasting a list into another list. Closes #8160.


Additional information

I know, I used the best solution for detecting that content comes from pasting… How could we improve that?

@pomek pomek requested a review from jodator October 27, 2020 09:21
@jodator jodator self-assigned this Oct 28, 2020
@jodator
Copy link
Contributor

jodator commented Oct 28, 2020

@pomek I thought it would require extracting the if() to separate method but it turned out that it has many drawbacks: 00610fd.

  • There was missing wasFixed = true and the condition was causing infinite fix-loops as the check caught also cases of the same list types.
  • The logic was slightly different from shouldInheritListType() and the if( prevSibling && was duplicated from that function - so I've inlined those checks in new function.
  • Then it was just moving the method around.

@jodator
Copy link
Contributor

jodator commented Oct 28, 2020

Additionally, I've moved the check from the fixListStyleAttributeOnListItemElements() so the functions will not be re-created on every fixListStyleAttributeOnListItemElements() call.

Copy link
Contributor

@jodator jodator left a comment

Choose a reason for hiding this comment

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

LGTM ;)

@jodator jodator merged commit 5dd14a3 into master Oct 28, 2020
@jodator jodator deleted the i/8160 branch October 28, 2020 07:42
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.

Pasting list inside other list results in two list types on the same level
2 participants