1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 07:22:55 +08:00

change CreateListItem method in OsuMarkdownContainer

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-05-07 13:20:48 +07:00
parent 9233248a0b
commit 5b003750f8
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -30,7 +30,8 @@ namespace osu.Game.Graphics.Containers.Markdown
break;
case ListItemBlock listItemBlock:
var childContainer = CreateListItem(listItemBlock, level);
var isOrdered = ((ListBlock)listItemBlock.Parent).IsOrdered;
var childContainer = CreateListItem(listItemBlock, level, isOrdered);
container.Add(childContainer);
foreach (var single in listItemBlock)
base.AddMarkdownComponent(single, childContainer.Content, level);
@ -64,7 +65,13 @@ namespace osu.Game.Graphics.Containers.Markdown
Padding = new MarginPadding(0)
};
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock, int level) => new OsuMarkdownListItem(listItemBlock, level);
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock, int level, bool isOrdered)
{
if (isOrdered)
return new OsuMarkdownOrderedListItem(listItemBlock.Order);
return new OsuMarkdownUnorderedListItem(level);
}
protected override MarkdownPipeline CreateBuilder()
=> new MarkdownPipelineBuilder().UseAutoIdentifiers(AutoIdentifierOptions.GitHub)