mirror of
https://github.com/osukey/osukey.git
synced 2025-05-03 04:37:30 +09:00
Reference : -31579d45aa/resources/assets/less/bem/osu-md.less (L9)
-31579d45aa/resources/assets/less/variables.less (L161)
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
// 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.Inlines;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics.Containers.Markdown;
|
|
using osu.Framework.Graphics.Sprites;
|
|
using osu.Game.Graphics.Sprites;
|
|
using osu.Game.Overlays;
|
|
|
|
namespace osu.Game.Graphics.Containers.Markdown
|
|
{
|
|
public class OsuMarkdownTextFlowContainer : MarkdownTextFlowContainer
|
|
{
|
|
[Resolved]
|
|
private OverlayColourProvider colourProvider { get; set; }
|
|
|
|
protected override SpriteText CreateSpriteText() => new OsuSpriteText
|
|
{
|
|
Font = OsuFont.GetFont(size: 14),
|
|
};
|
|
|
|
protected override void AddLinkText(string text, LinkInline linkInline)
|
|
=> AddDrawable(new OsuMarkdownLinkText(text, linkInline));
|
|
|
|
// TODO : Add background (colour B6) and change font to monospace
|
|
protected override void AddCodeInLine(CodeInline codeInline)
|
|
=> AddText(codeInline.Content, t => { t.Colour = colourProvider.Light1; });
|
|
}
|
|
}
|