2021-04-27 15:17:51 +08:00
|
|
|
// 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;
|
2021-05-02 23:35:30 +08:00
|
|
|
using osu.Framework.Allocation;
|
2021-04-27 15:17:51 +08:00
|
|
|
using osu.Framework.Graphics.Containers.Markdown;
|
2021-05-02 23:35:30 +08:00
|
|
|
using osu.Game.Overlays;
|
2021-04-27 15:17:51 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Graphics.Containers.Markdown
|
|
|
|
{
|
|
|
|
public class OsuMarkdownTextFlowContainer : MarkdownTextFlowContainer
|
|
|
|
{
|
2021-05-02 23:35:30 +08:00
|
|
|
[Resolved]
|
|
|
|
private OverlayColourProvider colourProvider { get; set; }
|
|
|
|
|
2021-04-27 15:17:51 +08:00
|
|
|
protected override void AddLinkText(string text, LinkInline linkInline)
|
|
|
|
=> AddDrawable(new OsuMarkdownLinkText(text, linkInline));
|
2021-05-02 23:35:30 +08:00
|
|
|
|
|
|
|
// TODO : Add background (colour B6) and change font to monospace
|
|
|
|
protected override void AddCodeInLine(CodeInline codeInline)
|
|
|
|
=> AddText(codeInline.Content, t => { t.Colour = colourProvider.Light1; });
|
2021-04-27 15:17:51 +08:00
|
|
|
}
|
|
|
|
}
|