1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

use linq to find first literal inline

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-06-04 14:45:06 +07:00
parent 6c1fede18e
commit 6d6c03eafe
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Linq;
using Markdig.Syntax; using Markdig.Syntax;
using Markdig.Syntax.Inlines; using Markdig.Syntax.Inlines;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -66,7 +67,7 @@ namespace osu.Game.Overlays.Wiki
protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock) protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock)
{ {
var heading = base.CreateHeading(headingBlock); var heading = base.CreateHeading(headingBlock);
var title = ((LiteralInline)headingBlock.Inline.FirstChild).Content.ToString(); var title = ((LiteralInline)headingBlock.Inline.First(i => i is LiteralInline)).Content.ToString();
OnAddHeading(title, heading, headingBlock.Level); OnAddHeading(title, heading, headingBlock.Level);