mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
add OsuMarkdownTable
This commit is contained in:
parent
2252d308c8
commit
c09067c3d5
@ -85,5 +85,19 @@ Line below";
|
|||||||
@"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.";
|
@"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestTable()
|
||||||
|
{
|
||||||
|
AddStep("Add Table", () =>
|
||||||
|
{
|
||||||
|
markdownContainer.Text =
|
||||||
|
@"| Left Aligned | Center Aligned | Right Aligned |
|
||||||
|
| :------------------- | :--------------------: | ---------------------:|
|
||||||
|
| Long Align Left Text | Long Align Center Text | Long Align Right Text |
|
||||||
|
| Align Left | Align Center | Align Right |
|
||||||
|
| Left | Center | Right |";
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using Markdig;
|
using Markdig;
|
||||||
using Markdig.Extensions.AutoIdentifiers;
|
using Markdig.Extensions.AutoIdentifiers;
|
||||||
|
using Markdig.Extensions.Tables;
|
||||||
using Markdig.Extensions.Yaml;
|
using Markdig.Extensions.Yaml;
|
||||||
using Markdig.Syntax;
|
using Markdig.Syntax;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -34,6 +35,8 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||||||
|
|
||||||
protected override MarkdownQuoteBlock CreateQuoteBlock(QuoteBlock quoteBlock) => new OsuMarkdownQuoteBlock(quoteBlock);
|
protected override MarkdownQuoteBlock CreateQuoteBlock(QuoteBlock quoteBlock) => new OsuMarkdownQuoteBlock(quoteBlock);
|
||||||
|
|
||||||
|
protected override MarkdownTable CreateTable(Table table) => new OsuMarkdownTable(table);
|
||||||
|
|
||||||
protected override MarkdownPipeline CreateBuilder()
|
protected override MarkdownPipeline CreateBuilder()
|
||||||
=> new MarkdownPipelineBuilder().UseAutoIdentifiers(AutoIdentifierOptions.GitHub)
|
=> new MarkdownPipelineBuilder().UseAutoIdentifiers(AutoIdentifierOptions.GitHub)
|
||||||
.UseEmojiAndSmiley()
|
.UseEmojiAndSmiley()
|
||||||
|
18
osu.Game/Graphics/Containers/Markdown/OsuMarkdownTable.cs
Normal file
18
osu.Game/Graphics/Containers/Markdown/OsuMarkdownTable.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using Markdig.Extensions.Tables;
|
||||||
|
using osu.Framework.Graphics.Containers.Markdown;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Containers.Markdown
|
||||||
|
{
|
||||||
|
public class OsuMarkdownTable : MarkdownTable
|
||||||
|
{
|
||||||
|
public OsuMarkdownTable(Table table)
|
||||||
|
: base(table)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override MarkdownTableCell CreateTableCell(TableCell cell, TableColumnDefinition definition, bool isHeading) => new OsuMarkdownTableCell(cell, definition, isHeading);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user