mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
tidy up sidebar test
This commit is contained in:
@ -6,7 +6,6 @@ using Markdig.Syntax;
|
|||||||
using Markdig.Syntax.Inlines;
|
using Markdig.Syntax.Inlines;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Containers.Markdown;
|
|
||||||
using osu.Game.Graphics.Containers.Markdown;
|
using osu.Game.Graphics.Containers.Markdown;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Wiki;
|
using osu.Game.Overlays.Wiki;
|
||||||
@ -54,16 +53,13 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
|
|
||||||
private void addTitle(string text, bool subtitle = false)
|
private void addTitle(string text, bool subtitle = false)
|
||||||
{
|
{
|
||||||
var headingBlock = createHeadingBlock(text, subtitle ? 3 : 2);
|
var headingBlock = new HeadingBlock(new HeadingBlockParser())
|
||||||
sidebar.AddToc(headingBlock, createHeading(headingBlock));
|
|
||||||
}
|
|
||||||
|
|
||||||
private HeadingBlock createHeadingBlock(string text, int level = 2) => new HeadingBlock(new HeadingBlockParser())
|
|
||||||
{
|
{
|
||||||
Inline = new ContainerInline().AppendChild(new LiteralInline(text)),
|
Inline = new ContainerInline().AppendChild(new LiteralInline(text)),
|
||||||
Level = level,
|
Level = subtitle ? 3 : 2,
|
||||||
};
|
};
|
||||||
|
var heading = new OsuMarkdownHeading(headingBlock);
|
||||||
private MarkdownHeading createHeading(HeadingBlock headingBlock) => new OsuMarkdownHeading(headingBlock);
|
sidebar.AddToc(headingBlock, heading);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user