mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 02:22:55 +08:00
Add custom container extension support
This commit is contained in:
parent
a1f96ad5f8
commit
098a56a784
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using Markdig;
|
using Markdig;
|
||||||
using Markdig.Extensions.AutoLinks;
|
using Markdig.Extensions.AutoLinks;
|
||||||
|
using Markdig.Extensions.CustomContainers;
|
||||||
using Markdig.Extensions.EmphasisExtras;
|
using Markdig.Extensions.EmphasisExtras;
|
||||||
using Markdig.Extensions.Footnotes;
|
using Markdig.Extensions.Footnotes;
|
||||||
using Markdig.Extensions.Tables;
|
using Markdig.Extensions.Tables;
|
||||||
@ -32,6 +33,12 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||||||
/// <seealso cref="AutoLinkExtension"/>
|
/// <seealso cref="AutoLinkExtension"/>
|
||||||
protected virtual bool Autolinks => false;
|
protected virtual bool Autolinks => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows this markdown container to parse custom containers (used for flags and infoboxes).
|
||||||
|
/// </summary>
|
||||||
|
/// <seealso cref="CustomContainerExtension"/>
|
||||||
|
protected virtual bool CustomContainers => false;
|
||||||
|
|
||||||
public OsuMarkdownContainer()
|
public OsuMarkdownContainer()
|
||||||
{
|
{
|
||||||
LineSpacing = 21;
|
LineSpacing = 21;
|
||||||
@ -107,6 +114,9 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||||||
if (Autolinks)
|
if (Autolinks)
|
||||||
pipeline = pipeline.UseAutoLinks();
|
pipeline = pipeline.UseAutoLinks();
|
||||||
|
|
||||||
|
if (CustomContainers)
|
||||||
|
pipeline.UseCustomContainers();
|
||||||
|
|
||||||
return pipeline.Build();
|
return pipeline.Build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user