mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 04:13:00 +08:00
add inline code colour
Reference : 31579d45aa/resources/assets/less/bem/osu-md.less (L12-L17)
This commit is contained in:
parent
fc4fa4f696
commit
88aaa9b332
@ -59,6 +59,15 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestInlineCode()
|
||||
{
|
||||
AddStep("Add inline code", () =>
|
||||
{
|
||||
markdownContainer.Text = "This is `inline code` text";
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFencedCodeBlock()
|
||||
{
|
||||
|
@ -2,13 +2,22 @@
|
||||
// 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.Game.Overlays;
|
||||
|
||||
namespace osu.Game.Graphics.Containers.Markdown
|
||||
{
|
||||
public class OsuMarkdownTextFlowContainer : MarkdownTextFlowContainer
|
||||
{
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; }
|
||||
|
||||
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; });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user