using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ConsoleTableExt;
using Markdig.Extensions.Tables;
namespace MfGames.Markdown.Gemtext.Renderers.Gemtext.Blocks
{
public class TableRenderer : GemtextObjectRenderer
{
private readonly Action? configureTableBuilder;
public TableRenderer(Action? configureTableBuilder)
{
this.configureTableBuilder = configureTableBuilder;
}
protected override void Write(GemtextRenderer renderer, Table table)
{
// Make sure we have plenty of space above us.
renderer.EnsureTwoLines();
// Since Gemtext doesn't have a table format per-se, we are going
// to use ConsoleTableEx to make a nicely-formatted table and emit
// the lines directly. That should produce the desired result.
// Gather up information about the data since that is where the
// builder starts with.
bool hasHeader = false;
List