1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 18:27:26 +08:00

use ListBlock IsOrdered to determine ordered or unordered list

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-04-30 11:48:37 +07:00
parent 11d0f12455
commit fc4fa4f696
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2
2 changed files with 5 additions and 4 deletions

View File

@ -50,7 +50,7 @@ namespace osu.Game.Graphics.Containers.Markdown
Padding = new MarginPadding(0)
};
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock, int level) => new OsuMarkdownListItem(level, listItemBlock.Order);
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock, int level) => new OsuMarkdownListItem(listItemBlock, level);
protected override MarkdownPipeline CreateBuilder()
=> new MarkdownPipelineBuilder().UseAutoIdentifiers(AutoIdentifierOptions.GitHub)

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using Markdig.Syntax;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -23,11 +24,11 @@ namespace osu.Game.Graphics.Containers.Markdown
public FillFlowContainer Content { get; }
public OsuMarkdownListItem(int level, int order)
public OsuMarkdownListItem(ListItemBlock listItemBlock, int level)
{
this.level = level;
this.order = order;
isOrdered = order != 0;
this.order = listItemBlock.Order;
isOrdered = ((ListBlock)listItemBlock.Parent).IsOrdered;
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;