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

Fix #2755 After modifying the list type and the indentation, the list types within the same list may be inconsistent. #2795

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

JiuqingSong
Copy link
Collaborator

@JiuqingSong JiuqingSong commented Sep 12, 2024

Currently when indent a list item, we always hard code its list style. However, if there is already a sibling list item that has this level, we should follow its list style.

With this change, when indent list item, we find its sibling list item (previous, then next), and follow its list style to apply to the new list item.

Test case:

<ol start="1" data-editing-info="{&quot;applyListStyleFromLevel&quot;:false,&quot;orderedStyleType&quot;:1}" style="list-style-type: decimal;"><li style="font-family: Calibri; font-size: 11pt; color: rgb(0, 0, 0);"><div>aaa</div></li><ol start="1" data-editing-info="{&quot;applyListStyleFromLevel&quot;:true,&quot;orderedStyleType&quot;:6}"><li style="font-family: Calibri; font-size: 11pt; color: rgb(0, 0, 0); list-style-type: &quot;a) &quot;;"><div>bbbb</div></li><li style="font-family: Calibri; font-size: 11pt; color: rgb(0, 0, 0); list-style-type: &quot;b) &quot;;"><div>cccc</div></li></ol><li style="font-family: Calibri; font-size: 11pt; color: rgb(0, 0, 0);"><div>dddd</div></li></ol><!--{"type":"range","start":[0,2,0,0,0],"end":[0,2,0,0,0],"isReverted":false,"isDarkMode":false}-->

Then press TAB key to indent

@JiuqingSong JiuqingSong merged commit 5480a82 into master Sep 13, 2024
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/2755 branch September 13, 2024 17:06
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.

2 participants