// Copyright (c) Rodel. All rights reserved.
// <auto-generated />

using HtmlAgilityPack;
using Markdig.Syntax.Inlines;

namespace BiliCopilot.UI.Controls.Markdown.Renderers.ObjectRenderers.Inlines;

internal class HtmlInlineRenderer : WinUIObjectRenderer<HtmlInline>
{
    protected override void Write(WinUIRenderer renderer, HtmlInline obj)
    {
        if (renderer == null)
        {
            throw new ArgumentNullException(nameof(renderer));
        }

        if (obj == null)
        {
            throw new ArgumentNullException(nameof(obj));
        }

        var html = obj.Tag;
        var doc = new HtmlDocument();
        doc.LoadHtml(html);
        HtmlWriter.WriteHtml(renderer, doc.DocumentNode.ChildNodes);
    }
}
