1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-24 19:17:20 +08:00

add OsuMarkdownSeparator

Reference
d56352aeef/resources/assets/less/bem/osu-md.less (L19-L21)
This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-04-28 09:23:05 +07:00
parent 6959f2a8cc
commit 6a921af085
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2
3 changed files with 41 additions and 0 deletions

View File

@ -62,5 +62,18 @@ This is markdown code block.
```";
});
}
[Test]
public void TestSeparator()
{
AddStep("Add Seperator", () =>
{
markdownContainer.Text = @"Line above
---
Line below";
});
}
}
}

View File

@ -30,6 +30,8 @@ namespace osu.Game.Graphics.Containers.Markdown
protected override MarkdownFencedCodeBlock CreateFencedCodeBlock(FencedCodeBlock fencedCodeBlock) => new OsuMarkdownFencedCodeBlock(fencedCodeBlock);
protected override MarkdownSeparator CreateSeparator(ThematicBreakBlock thematicBlock) => new OsuMarkdownSeparator();
protected override MarkdownPipeline CreateBuilder()
=> new MarkdownPipelineBuilder().UseAutoIdentifiers(AutoIdentifierOptions.GitHub)
.UseEmojiAndSmiley()

View File

@ -0,0 +1,26 @@
// 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 osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers.Markdown;
using osu.Game.Overlays;
namespace osu.Game.Graphics.Containers.Markdown
{
public class OsuMarkdownSeparator : MarkdownSeparator
{
private Drawable separator;
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
separator.Colour = colourProvider.Background3;
}
protected override Drawable CreateSeparator()
{
return separator = base.CreateSeparator();
}
}
}