mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:22:56 +08:00
Merge pull request #13851 from gagahpangeran/autolink-md
Add autolink support in osu markdown container
This commit is contained in:
commit
8d82412b39
@ -95,6 +95,15 @@ _**italic with underscore, bold with asterisk**_";
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestAutoLink()
|
||||||
|
{
|
||||||
|
AddStep("Add autolink", () =>
|
||||||
|
{
|
||||||
|
markdownContainer.Text = "<https://discord.gg/ppy>";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestInlineCode()
|
public void TestInlineCode()
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,12 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||||||
title = linkInline.Title;
|
title = linkInline.Title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OsuMarkdownLinkText(AutolinkInline autolinkInline)
|
||||||
|
: base(autolinkInline)
|
||||||
|
{
|
||||||
|
text = autolinkInline.Url;
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,9 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||||||
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));
|
||||||
|
|
||||||
|
protected override void AddAutoLink(AutolinkInline autolinkInline)
|
||||||
|
=> AddDrawable(new OsuMarkdownLinkText(autolinkInline));
|
||||||
|
|
||||||
protected override void AddImage(LinkInline linkInline) => AddDrawable(new OsuMarkdownImage(linkInline));
|
protected override void AddImage(LinkInline linkInline) => AddDrawable(new OsuMarkdownImage(linkInline));
|
||||||
|
|
||||||
// TODO : Change font to monospace
|
// TODO : Change font to monospace
|
||||||
|
Loading…
Reference in New Issue
Block a user