mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
add inline code colour
Reference : 31579d45aa/resources/assets/less/bem/osu-md.less (L12-L17)
This commit is contained in:
@ -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]
|
[Test]
|
||||||
public void TestFencedCodeBlock()
|
public void TestFencedCodeBlock()
|
||||||
{
|
{
|
||||||
|
@ -2,13 +2,22 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using Markdig.Syntax.Inlines;
|
using Markdig.Syntax.Inlines;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Containers.Markdown;
|
using osu.Framework.Graphics.Containers.Markdown;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers.Markdown
|
namespace osu.Game.Graphics.Containers.Markdown
|
||||||
{
|
{
|
||||||
public class OsuMarkdownTextFlowContainer : MarkdownTextFlowContainer
|
public class OsuMarkdownTextFlowContainer : MarkdownTextFlowContainer
|
||||||
{
|
{
|
||||||
|
[Resolved]
|
||||||
|
private OverlayColourProvider colourProvider { get; set; }
|
||||||
|
|
||||||
protected override void AddLinkText(string text, LinkInline linkInline)
|
protected override void AddLinkText(string text, LinkInline linkInline)
|
||||||
=> AddDrawable(new OsuMarkdownLinkText(text, 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; });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user