Example #1
0
        protected override void Write(BlazorRenderer renderer, DelimiterInline delimiter)
        {
            if (delimiter.Type != DelimiterType.Close)
            {
                renderer.AddMarkupContent(delimiter.ToLiteral());
            }

            renderer.WriteChildren(delimiter);

            if (delimiter.Type == DelimiterType.Close)
            {
                renderer.AddMarkupContent(delimiter.ToLiteral());
            }
        }
Example #2
0
        protected override void Write(BlazorRenderer renderer, FootnoteGroup footnotes)
        {
            renderer.OpenElement("div");
            renderer.AddAttribute("class", "footnotes");
            renderer.AddMarkupContent("<hr />");
            renderer.OpenElement("ol");

            for (int i = 0; i < footnotes.Count; i++)
            {
                var footnote = (Footnote)footnotes[i];
                renderer.OpenElement("li");
                renderer.AddAttribute("id", $"fn:{footnote.Order}");
                renderer.WriteChildren(footnote);
                renderer.CloseElement();
            }

            renderer.CloseElement();
            renderer.CloseElement();
        }
        protected override void Write(BlazorRenderer renderer, FootnoteLink link)
        {
            renderer.OpenElement("a");

            if (link.IsBackLink)
            {
                renderer.AddAttribute("class", "footnote-back-ref");
                renderer.AddAttribute("href", $"#fnref:{link.Index}");
                renderer.AddContent("&#8617;");
            }
            else
            {
                var order = link.Footnote.Order;
                renderer.AddAttribute("id", $"#fnref:{link.Index}");
                renderer.AddAttribute("class", "footnote-ref");
                renderer.AddAttribute("href", $"#fn:{order}");
                renderer.AddMarkupContent($"<sup>{order}</sup>");
            }

            renderer.CloseElement();
        }
Example #4
0
 protected override void Write(BlazorRenderer renderer, HtmlInline inline)
 {
     renderer.AddMarkupContent(inline.Tag);
 }
Example #5
0
 protected override void Write(BlazorRenderer renderer, TaskList list)
 {
     renderer.OpenElement("span");
     renderer.AddMarkupContent(list.Checked ? "&#128505;" : "&#9744;");
     renderer.CloseElement();
 }