mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:43:20 +08:00
Add custom container extension support
This commit is contained in:
parent
a1f96ad5f8
commit
098a56a784
@ -5,6 +5,7 @@
|
||||
|
||||
using Markdig;
|
||||
using Markdig.Extensions.AutoLinks;
|
||||
using Markdig.Extensions.CustomContainers;
|
||||
using Markdig.Extensions.EmphasisExtras;
|
||||
using Markdig.Extensions.Footnotes;
|
||||
using Markdig.Extensions.Tables;
|
||||
@ -32,6 +33,12 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
/// <seealso cref="AutoLinkExtension"/>
|
||||
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()
|
||||
{
|
||||
LineSpacing = 21;
|
||||
@ -107,6 +114,9 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
if (Autolinks)
|
||||
pipeline = pipeline.UseAutoLinks();
|
||||
|
||||
if (CustomContainers)
|
||||
pipeline.UseCustomContainers();
|
||||
|
||||
return pipeline.Build();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user