1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 02:37:25 +08:00
osu-lazer/osu.Game/Overlays/Wiki/Markdown/WikiMarkdownImage.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
994 B
C#
Raw Normal View History

2021-05-02 23:02:06 +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.
2022-06-17 15:37:17 +08:00
#nullable disable
2021-05-02 23:02:06 +08:00
using Markdig.Syntax.Inlines;
using osu.Game.Graphics.Containers.Markdown;
2021-05-02 23:02:06 +08:00
namespace osu.Game.Overlays.Wiki.Markdown
{
public partial class WikiMarkdownImage : OsuMarkdownImage
2021-05-02 23:02:06 +08:00
{
public WikiMarkdownImage(LinkInline linkInline)
: base(linkInline)
2021-05-02 23:02:06 +08:00
{
}
protected override ImageContainer CreateImageContainer(string url)
2021-05-02 23:02:06 +08:00
{
// The idea is replace "https://website.url/wiki/{path-to-image}" to "https://website.url/wiki/images/{path-to-image}"
2021-05-02 23:02:06 +08:00
// "/wiki/images/*" is route to fetch wiki image from osu!web server (see: https://github.com/ppy/osu-web/blob/4205eb66a4da86bdee7835045e4bf28c35456e04/routes/web.php#L289)
url = url.Replace("/wiki/", "/wiki/images/");
2021-05-02 23:02:06 +08:00
return base.CreateImageContainer(url);
2021-05-02 23:02:06 +08:00
}
}
}