6using System.Threading.Tasks;
83 bool LetterOrUnderscore =
false;
84 StringBuilder sb =
new StringBuilder();
86 foreach (
char ch
in Path.ChangeExtension(FileName,
null))
88 if (
char.IsLetter(ch) || ch ==
'_')
91 LetterOrUnderscore =
true;
93 else if (
char.IsDigit(ch))
95 if (!LetterOrUnderscore)
98 LetterOrUnderscore =
true;
106 LetterOrUnderscore =
true;
110 string Name = sb.ToString();
112 this.
Output.Append(
"function CreateInnerHTML");
114 this.
Output.AppendLine(
"(ElementId, Args)");
115 this.
Output.AppendLine(
"{");
116 this.
Output.AppendLine(
"\tvar Element = document.getElementById(ElementId);");
117 this.
Output.AppendLine(
"\tif (Element)");
118 this.
Output.Append(
"\t\tElement.innerHTML = CreateHTML");
120 this.
Output.AppendLine(
"(Args);");
121 this.
Output.AppendLine(
"}");
123 this.
Output.Append(
"function CreateHTML");
125 this.
Output.AppendLine(
"(Args)");
126 this.
Output.AppendLine(
"{");
127 this.
Output.Append(
"\tvar Segments = [");
129 this.firstSegment =
true;
131 return Task.CompletedTask;
134 private bool firstSegment;
136 private void AppendHtml(
string Html)
138 this.AppendHtml(Html,
false,
false);
141 private void AppendHtml(
string Html,
bool Script,
bool AppendNewLine)
143 if (this.firstSegment)
144 this.firstSegment =
false;
149 this.
Output.Append(
"\t\t");
159 this.
Output.Append(jsonEncodedNewLine);
165 private void AppendHtmlLine()
167 this.AppendHtml(
string.Empty,
false,
true);
170 private void AppendHtmlLine(
string Html)
172 this.AppendHtml(Html,
false,
true);
175 private static readonly
string jsonEncodedNewLine =
JSON.
Encode(Environment.NewLine);
182 this.AppendHtmlLine(
"<div class=\"footnotes\">");
183 this.AppendHtmlLine(
"<hr />");
184 this.AppendHtmlLine(
"<ol>");
188 if ((this.
Document?.TryGetFootnoteNumber(Key, out
int Nr) ??
false) &&
192 this.AppendHtml(
"<li id=\"fn-" + Nr.ToString() +
"\">");
199 P.AddChild(Backlink);
203 Footnote.BacklinkAdded =
true;
208 this.AppendHtmlLine(
"</li>");
212 this.AppendHtmlLine(
"</ol>");
213 this.AppendHtmlLine(
"</div>");
221 this.
Output.AppendLine(
"];");
222 this.
Output.AppendLine(
"\treturn Segments.join(\"\");");
223 this.
Output.AppendLine(
"}");
225 return Task.CompletedTask;
228 #region Span Elements
236 this.AppendHtml(
"<abbr data-title=\"" +
241 this.AppendHtml(
"</abbr>");
250 string s = Element.
EMail;
251 byte[] Data = Encoding.ASCII.GetBytes(s);
252 StringBuilder sb =
new StringBuilder();
254 foreach (
byte b
in Data)
257 sb.Append(b.ToString(
"X2"));
264 Data = Encoding.ASCII.GetBytes(
"mailto:");
265 foreach (
byte b
in Data)
268 sb.Append(b.ToString(
"X2"));
272 this.AppendHtml(
"<a href=\"" + sb.ToString() + s +
"\">" + s +
"</a>");
274 return Task.CompletedTask;
283 bool IsRelative = Element.
URL.IndexOf(
':') < 0;
285 this.AppendHtml(
"<a href=\"" +
289 this.AppendHtml(
"\" target=\"_blank");
293 return Task.CompletedTask;
302 this.AppendHtml(
"<del>");
304 this.AppendHtml(
"</del>");
327 if (EmojiSource is
null)
333 StringBuilder sb =
new StringBuilder();
335 this.AppendHtml(sb.ToString());
338 return Task.CompletedTask;
347 this.AppendHtml(
"<em>");
349 this.AppendHtml(
"</em>");
364 await this.
Render(Footnote);
365 else if (this.
Document?.TryGetFootnoteNumber(Element.
Key, out
int Nr) ??
false)
369 this.AppendHtml(
"<sup id=\"fnref-" + s +
"\"><a href=\"#fn-" + s +
370 "\" class=\"footnote-ref\">" + s +
"</a></sup>");
373 Footnote.Referenced =
true;
383 this.AppendHtml(
"<mark");
385 string s = this.htmlSettings?.HashtagClass;
387 if (!
string.IsNullOrEmpty(s))
390 s = this.htmlSettings?.HashtagClickScript;
392 if (!
string.IsNullOrEmpty(s))
395 this.AppendHtml(
">" + Element.
Tag +
"</mark>");
397 return Task.CompletedTask;
406 if (this.htmlSettings?.XmlEntitiesOnly ??
true)
416 this.AppendHtml(
"&" + Element.
Entity +
";");
423 this.AppendHtml(
"&" + Element.
Entity.ToLower() +
";");
427 string s = Html.HtmlEntity.EntityToCharacter(Element.
Entity);
428 if (!
string.IsNullOrEmpty(s))
434 this.AppendHtml(
"&" + Element.
Entity +
";");
436 return Task.CompletedTask;
445 this.AppendHtml(
"&#" + Element.
Code.ToString() +
";");
447 return Task.CompletedTask;
458 return Task.CompletedTask;
467 this.AppendHtml(Element.
HTML);
469 return Task.CompletedTask;
479 return Task.CompletedTask;
493 if (Result is XmlDocument Xml)
498 if (Result is
Graph G)
503 if (AloneInParagraph)
504 this.AppendHtml(
"<figure>");
508 "\" src=\"data:image/png;base64," + Convert.ToBase64String(Bin, 0, Bin.Length) +
514 this.AppendHtml(
"Graph");
516 this.AppendHtml(
"\" />");
518 if (AloneInParagraph)
519 this.AppendHtml(
"</figure>");
523 byte[] Bin = Pixels.EncodeAsPng();
525 if (AloneInParagraph)
526 this.AppendHtml(
"<figure>");
528 this.AppendHtml(
"<img border=\"2\" width=\"" + Pixels.Width.ToString() +
529 "\" height=\"" + Pixels.Height.ToString() +
"\" src=\"data:image/png;base64," +
530 Convert.ToBase64String(Bin, 0, Bin.Length) +
"\" alt=\"Image\" />");
532 if (AloneInParagraph)
533 this.AppendHtml(
"</figure>");
535 else if (Result is SKImage Img)
537 using (SKData Data = Img.Encode(SKEncodedImageFormat.Png, 100))
539 byte[] Bin = Data.ToArray();
541 if (AloneInParagraph)
542 this.AppendHtml(
"<figure>");
544 this.AppendHtml(
"<img border=\"2\" width=\"" + Img.Width.ToString() +
545 "\" height=\"" + Img.Height.ToString() +
"\" src=\"data:image/png;base64," +
546 Convert.ToBase64String(Bin, 0, Bin.Length) +
"\" alt=\"Image\" />");
548 if (AloneInParagraph)
549 this.AppendHtml(
"</figure>");
555 Doc.ProcessAsyncTasks();
561 Doc.ProcessAsyncTasks();
563 else if (Result is Exception ex)
567 this.AppendHtmlLine(
"<font class=\"error\">");
569 if (ex is AggregateException ex2)
571 foreach (Exception ex3
in ex2.InnerExceptions)
576 if (AloneInParagraph)
577 this.AppendHtml(
"<p>");
581 if (AloneInParagraph)
582 this.AppendHtml(
"</p>");
585 this.AppendHtmlLine(
"</font>");
587 else if (Result is
ObjectMatrix M && !(M.ColumnNames is
null))
589 this.AppendHtml(
"<table><thead><tr>");
591 foreach (
string s2
in M.ColumnNames)
594 this.AppendHtml(
"</tr></thead><tbody>");
598 for (y = 0; y < M.Rows; y++)
600 this.AppendHtml(
"<tr>");
602 for (x = 0; x < M.Columns; x++)
604 this.AppendHtml(
"<td>");
606 object Item = M.GetElement(x, y).AssociatedObjectValue;
609 if (Item is
string s2)
612 await Element.Render(
this);
617 this.AppendHtml(
"</td>");
620 this.AppendHtml(
"</tr>");
623 this.AppendHtml(
"</tbody></table>");
625 else if (Result is Array A)
627 foreach (
object Item
in A)
632 if (AloneInParagraph)
633 this.AppendHtml(
"<p>");
637 if (AloneInParagraph)
638 this.AppendHtml(
"</p>");
641 if (AloneInParagraph)
642 this.AppendHtmlLine();
645 private static string FormatText(
string s)
647 return s.Replace(
"\r\n",
"\n").Replace(
"\n",
"<br/>").Replace(
"\r",
"<br/>").
648 Replace(
"\t",
" ").Replace(
" ",
" ");
659 return Task.CompletedTask;
668 this.AppendHtml(
"<ins>");
670 this.AppendHtml(
"</ins>");
679 this.AppendHtmlLine(
"<br/>");
681 return Task.CompletedTask;
702 bool IsRelative = Url.IndexOf(
':') < 0;
704 if (!IsRelative && Url.StartsWith(
"javascript:", StringComparison.OrdinalIgnoreCase))
706 this.AppendHtml(
"<a href=\"#\" onclick=\"" +
714 if (!
string.IsNullOrEmpty(Title))
718 this.AppendHtml(
"\" target=\"_blank");
720 this.AppendHtml(
"\">");
722 await this.
Render(ChildNodes);
724 this.AppendHtml(
"</a>");
747 bool FirstOnRow =
true;
749 if (Element.
TryGetMetaData(out KeyValuePair<string, bool>[] Values))
751 foreach (KeyValuePair<string, bool> P
in Values)
756 this.AppendHtml(
" ");
761 this.AppendHtmlLine(
"<br/>");
767 return Task.CompletedTask;
784 this.AppendHtml(Renderer2.
ToString());
805 this.AppendHtml(Renderer2.
ToString());
820 this.AppendHtml(
"<s>");
822 this.AppendHtml(
"</s>");
831 this.AppendHtml(
"<strong>");
833 this.AppendHtml(
"</strong>");
842 this.AppendHtml(
"<sub>");
844 this.AppendHtml(
"</sub>");
853 this.AppendHtml(
"<sup>");
855 this.AppendHtml(
"</sup>");
864 this.AppendHtml(
"<u>");
866 this.AppendHtml(
"</u>");
871 #region Block elements
879 this.AppendHtmlLine(
"<blockquote>");
881 this.AppendHtmlLine(
"</blockquote>");
890 this.AppendHtmlLine(
"<ul>");
892 this.AppendHtmlLine(
"</ul>");
901 this.AppendHtmlLine(
"<div class='horizontalAlignCenter'>");
903 this.AppendHtmlLine(
"</div>");
922 this.AppendHtml(Renderer2.
ToString());
931 this.AppendHtmlLine(
"<font class=\"error\">");
933 if (ex is AggregateException ex2)
935 foreach (Exception ex3
in ex2.InnerExceptions)
941 this.AppendHtml(
"</font>");
947 this.AppendHtml(
"<pre><code class=\"");
949 if (
string.IsNullOrEmpty(Element.
Language))
950 this.AppendHtml(
"nohighlight");
954 this.AppendHtml(
"\">");
956 for (i = Element.
Start; i <= Element.
End; i++)
959 this.AppendHtmlLine(
"</code></pre>");
968 return Task.CompletedTask;
980 while (!(Loop is
null))
982 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
984 this.AppendHtml(
"<dd>");
985 await Loop[i].Render(
this);
986 this.AppendHtmlLine(
"</dd>");
999 this.AppendHtmlLine(
"<dl>");
1001 this.AppendHtmlLine(
"</dl>");
1013 while (!(Loop is
null))
1015 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1017 this.AppendHtml(
"<dt>");
1018 await Loop[i].Render(
this);
1019 this.AppendHtmlLine(
"</dt>");
1032 this.AppendHtmlLine(
"<blockquote class=\"deleted\">");
1036 this.AppendHtmlLine(
"</blockquote>");
1054 this.AppendHtml(
"<h" + Element.
Level.ToString());
1056 string Id = await Element.
Id;
1058 if (!
string.IsNullOrEmpty(Id))
1062 this.AppendHtml(
" class=\"tocReference\"");
1064 this.AppendHtml(
">");
1068 this.AppendHtmlLine(
"</h" + Element.
Level.ToString() +
">");
1077 this.AppendHtmlLine(
"<hr/>");
1079 return Task.CompletedTask;
1089 this.AppendHtmlLine();
1098 this.AppendHtmlLine(
"<blockquote class=\"inserted\">");
1100 this.AppendHtmlLine(
"</blockquote>");
1109 return Task.CompletedTask;
1118 this.AppendHtmlLine(
"<div class='horizontalAlignLeft'>");
1120 this.AppendHtmlLine(
"</div>");
1129 this.AppendHtmlLine(
"<div class='horizontalAlignMargins'>");
1131 this.AppendHtmlLine(
"</div>");
1150 this.AppendHtml(
"<li value=\"" + Element.
Number.ToString() +
"\">");
1152 this.AppendHtml(
"<li>");
1156 this.AppendHtmlLine(
"</li>");
1171 this.AppendHtmlLine(
"<ol>");
1173 while (!(Loop is
null))
1175 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1183 else if (Item.
Number == Expected)
1185 this.AppendHtml(
"<li>");
1187 this.AppendHtmlLine(
"</li>");
1199 this.AppendHtmlLine(
"</ol>");
1209 this.AppendHtml(
"<p>");
1214 this.AppendHtmlLine(
"</p>");
1223 this.AppendHtmlLine(
"<div class='horizontalAlignRight'>");
1225 this.AppendHtmlLine(
"</div>");
1236 this.AppendHtmlLine(
"</section>");
1239 private void GenerateSectionHTML(
int NrColumns)
1241 this.AppendHtml(
"<section");
1245 string s = NrColumns.ToString();
1247 this.AppendHtml(
" style=\"-webkit-column-count:" + s +
";-moz-column-count:" +
1248 s +
";column-count:" + s +
"\"");
1251 this.AppendHtmlLine(
">");
1260 this.AppendHtmlLine(
"</section>");
1261 this.GenerateSectionHTML(Element.
NrColumns);
1263 return Task.CompletedTask;
1275 int NrRows, RowIndex;
1276 int NrColumns = Element.
Columns;
1278 bool OnlyRows =
false;
1280 if (Element.
Headers.Length == 0 && !(
this.Document?.Elements is
null))
1287 while (!(Loop is
null))
1289 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1291 if (Loop[i] != Element)
1305 this.AppendHtmlLine(
"<table>");
1307 if (!
string.IsNullOrEmpty(Element.
Id))
1311 if (
string.IsNullOrEmpty(Element.
Caption))
1316 this.AppendHtmlLine(
"</caption>");
1319 this.AppendHtmlLine(
"<colgroup>");
1322 this.AppendHtmlLine(
"<col style=\"text-align:" + Alignment.ToString().ToLower() +
"\"/>");
1324 this.AppendHtmlLine(
"</colgroup>");
1326 this.AppendHtmlLine(
"<thead>");
1328 NrRows = Element.
Headers.Length;
1329 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1331 Row = Element.
Headers[RowIndex];
1334 this.AppendHtmlLine(
"<tr>");
1336 for (i = 0; i < NrColumns; i++)
1344 while (j < NrColumns && Row[j++] is
null)
1347 this.AppendHtml(
"<th style=\"text-align:" +
1351 this.AppendHtml(
"\" colspan=\"" + k.ToString());
1353 this.AppendHtml(
"\">");
1355 this.AppendHtmlLine(
"</th>");
1358 this.AppendHtmlLine(
"</tr>");
1360 this.AppendHtmlLine(
"</thead>");
1362 this.AppendHtmlLine(
"<tbody>");
1365 NrRows = Element.
Rows.Length;
1366 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1368 Row = Element.
Rows[RowIndex];
1371 this.AppendHtmlLine(
"<tr>");
1373 for (i = 0; i < NrColumns; i++)
1381 while (j < NrColumns && Row[j++] is
null)
1384 this.AppendHtml(
"<td style=\"text-align:" +
1388 this.AppendHtml(
"\" colspan=\"" + k.ToString());
1390 this.AppendHtml(
"\">");
1392 this.AppendHtmlLine(
"</td>");
1395 this.AppendHtmlLine(
"</tr>");
1400 this.AppendHtmlLine(
"</tbody>");
1401 this.AppendHtmlLine(
"</table>");
1411 this.AppendHtml(
"<li class=\"taskListItem\"><input disabled=\"disabled");
1415 this.AppendHtml(
"\" id=\"item" + Element.
CheckPosition.ToString() +
1419 this.AppendHtml(
"\" type=\"checkbox\"");
1422 this.AppendHtml(
" checked=\"checked\"");
1424 this.AppendHtml(
"/><span></span><label class=\"taskListItemLabel\"");
1427 this.AppendHtml(
" for=\"item" + Element.
CheckPosition.ToString() +
"\"");
1429 this.AppendHtml(
">");
1436 bool EndLabel =
true;
1439 while (!(Loop is
null))
1441 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1462 this.AppendHtml(
"</label>");
1474 this.AppendHtml(
"</label>");
1476 this.AppendHtmlLine(
"</li>");
1481 this.AppendHtmlLine(
"</label></li>");
1491 this.AppendHtmlLine(
"<ul class=\"taskList\">");
1493 this.AppendHtmlLine(
"</ul>");
1502 this.AppendHtml(
"<li");
1506 if (!(Detail is
null))
1511 this.AppendHtml(
" class=\"active\"");
1521 this.AppendHtml(
" class=\"active\"");
1526 this.AppendHtml(
">");
1528 this.AppendHtmlLine(
"</li>");
string ShortName
Emoji short name.
string Unicode
Unicode representation of emoji.
Helps with common JSON-related tasks.
static string Encode(string s)
Encodes a string for inclusion in JSON.
Renders JavaScript from a Markdown document.
async Task RenderObject(object Result, bool AloneInParagraph, Variables Variables)
Generates HTML from Script output.
override async Task Render(Delete Element)
Renders Element .
override async Task Render(TaskItem Element)
Renders Element .
override async Task Render(NumberedItem Element)
Renders Element .
override Task RenderDocumentHeader()
Renders the document header.
override async Task Render(BlockQuote Element)
Renders Element .
override Task Render(Link Element)
Renders Element .
override async Task Render(NumberedList Element)
Renders Element .
override async Task Render(Paragraph Element)
Renders Element .
override async Task Render(BulletList Element)
Renders Element .
override Task Render(DetailsReference Element)
Renders Element .
override async Task Render(MarginAligned Element)
Renders Element .
override Task RenderDocumentFooter()
Renders the document header.
override async Task Render(DeleteBlocks Element)
Renders Element .
override async Task Render(StrikeThrough Element)
Renders Element .
override async Task Render(HtmlBlock Element)
Renders Element .
override Task Render(InlineText Element)
Renders Element .
override async Task Render(SuperScript Element)
Renders Element .
override async Task Render(Table Element)
Renders Element .
override Task Render(HashTag Element)
Renders Element .
override async Task Render(Header Element)
Renders Element .
override async Task Render(TaskList Element)
Renders Element .
override async Task Render(DefinitionDescriptions Element)
Renders Element .
JavaScriptRenderer(HtmlSettings HtmlSettings, MarkdownDocument Document)
Renders JavaScript from a Markdown document.
override async Task Render(LeftAligned Element)
Renders Element .
override async Task Render(Abbreviation Element)
Renders Element .
override async Task RenderFootnotes()
Renders footnotes.
override async Task Render(Multimedia Element)
Renders Element .
override async Task Render(InsertBlocks Element)
Renders Element .
override async Task Render(Insert Element)
Renders Element .
override async Task Render(SubScript Element)
Renders Element .
override Task Render(InlineScript Element)
Renders Element .
override async Task Render(DefinitionTerms Element)
Renders Element .
override Task Render(CommentBlock Element)
Renders Element .
JavaScriptRenderer(StringBuilder Output, HtmlSettings HtmlSettings, MarkdownDocument Document)
Renders JavaScript from a Markdown document.
override Task Render(MetaReference Element)
Renders Element .
override async Task Render(Underline Element)
Renders Element .
override Task Render(LinkReference Element)
Renders Element .
override Task Render(SectionSeparator Element)
Renders Element .
override async Task Render(Strong Element)
Renders Element .
JavaScriptRenderer(HtmlSettings HtmlSettings)
Renders JavaScript from a Markdown document.
override async Task Render(UnnumberedItem Element)
Renders Element .
override Task Render(Footnote Element)
Renders Element .
override Task Render(InlineCode Element)
Renders Element .
override Task Render(NestedBlock Element)
Renders Element .
override async Task Render(Emphasize Element)
Renders Element .
override Task Render(HtmlEntity Element)
Renders Element .
override Task Render(LineBreak Element)
Renders Element .
JavaScriptRenderer(StringBuilder Output, HtmlSettings HtmlSettings)
Renders JavaScript from a Markdown document.
override Task Render(HtmlEntityUnicode Element)
Renders Element .
readonly HtmlSettings htmlSettings
HTML settings.
override Task Render(InvisibleBreak Element)
Renders Element .
override Task Render(HorizontalRule Element)
Renders Element .
override Task Render(EmojiReference Element)
Renders Element .
override async Task Render(CodeBlock Element)
Renders Element .
override Task Render(InlineHTML Element)
Renders Element .
async Task Render(string Url, string Title, ChunkedList< MarkdownElement > ChildNodes, MarkdownDocument Document)
Generates HTML for a link.
override async Task Render(Sections Element)
Renders Element .
override async Task Render(MultimediaReference Element)
Renders Element .
override async Task Render(CenterAligned Element)
Renders Element .
override Task Render(AutomaticLinkUrl Element)
Renders Element .
override async Task Render(RightAligned Element)
Renders Element .
override async Task Render(FootnoteReference Element)
Renders Element .
override Task Render(AutomaticLinkMail Element)
Renders Element .
override async Task Render(DefinitionList Element)
Renders Element .
Class that can be used to encapsulate Markdown to be returned from a Web Service, bypassing any encod...
Contains a markdown document. This markdown document class supports original markdown,...
static async Task< object > TransformXml(XmlDocument Xml, Variables Variables)
Transforms XML to an object that is easier to visualize.
bool IncludesTableOfContents
If the document contains a Table of Contents.
string CheckURL(string Url, string URL)
Checks the URL if it needs redirection to a proxy.
IEnumerable< string > FootnoteOrder
Order of footnotes.
IEmojiSource EmojiSource
Source for emojis in the document.
string ResourceName
Local resource name of Markdown document, if referenced through a web server. Master documents use th...
string FileName
Filename of Markdown document. Markdown inclusion will be made relative to this filename.
MarkdownDocument Detail
Detail document of a master document.
Multimedia GetReference(string Label)
Gets the multimedia information referenced by a label.
static Task< MarkdownDocument > CreateAsync(string MarkdownText, params Type[] TransparentExceptionTypes)
Contains a markdown document. This markdown document class supports original markdown,...
ChunkedList< MarkdownElement > Elements
Markdown elements making up the document.
Contains settings that the Markdown parser uses to customize its behavior.
Represents a block quote in a markdown document.
Represents a bullet list in a markdown document.
Represents a center-aligned set of blocks in a markdown document.
Represents a code block in a markdown document.
string IndentString
String used for indentation.
int Indent
Code block indentation.
string[] Rows
Rows in code block
Represents a definition list in a markdown document.
Represents inserted blocks in a markdown document.
Represents a block of HTML in a markdown document.
Represents inserted blocks in a markdown document.
Represents a left-aligned set of blocks in a markdown document.
Represents a margin-aligned set of blocks in a markdown document.
Represents a nested block with no special formatting rules in a markdown document.
override Task Render(IRenderer Output)
Renders the element.
Represents a numbered item in an ordered list.
bool NumberExplicit
If number is explicitly provided (true) or inferred (false).
int Number
Number associated with item.
override Task Render(IRenderer Output)
Renders the element.
Represents a numbered list in a markdown document.
Represents a paragraph in a markdown document.
bool Implicit
If paragraph is implicit or not.
Represents a right-aligned set of blocks in a markdown document.
int NrColumns
Number of columns in following section.
Represents a sequence of sections.
int InitialNrColumns
Number of columns for initial section.
Represents a table in a markdown document.
TextAlignment[] ColumnAlignments
Table column alignments.
string Caption
Table caption.
MarkdownElement[][] Headers
Headers in table.
int Columns
Number of columns.
TextAlignment?[][] RowCellAlignments
Row cell alignments in table.
TextAlignment?[][] HeaderCellAlignments
Header cell alignments in table.
MarkdownElement[][] Rows
Rows in table.
Represents a task item in a task list.
int CheckPosition
Position of the checkmark in the original markdown text document.
bool IsChecked
If the item is checked or not.
Represents a task list in a markdown document.
Represents an unnumbered item in an ordered list.
MarkdownElement LastChild
Last child, or null if none.
override ChunkedList< MarkdownElement > Children
Any children of the element.
virtual void AddChild(MarkdownElement NewChild)
Adds a child to the element.
Abstract base class for all markdown elements.
abstract Task Render(IRenderer Output)
Renders the element.
abstract bool InlineSpanElement
If the element is an inline span element.
MarkdownDocument Document
Markdown document.
MarkdownElement Child
Child element.
string Title
Optional title.
string Description
Description
string Delimiter
Delimiter string used to identify emoji.
int Level
Level (number of colons used to define the emoji)
EmojiInfo Emoji
Emoji information.
Represents an HTML entity.
Represents an HTML entity in Unicode format.
int Code
Unicode character
Expression Expression
Expression
string Value
Unformatted text.
string Title
Optional Link title.
bool TryGetMetaData(out KeyValuePair< string, bool >[] Values)
Tries to get meta-data from the document.
MultimediaItem[] Items
Multimedia items.
bool AloneInParagraph
If the element is alone in a paragraph.
bool AloneInParagraph
If the element is alone in a paragraph.
Renders HTML from a Markdown document.
Contains settings that the HTML export uses to customize HTML output.
Abstract base class for Markdown renderers.
readonly StringBuilder Output
Renderer output.
Task RenderChild(MarkdownElementSingleChild Element)
Renders the child of Element .
virtual async Task RenderDocument(MarkdownDocument Document, bool Inclusion)
Renders a document.
Task RenderChildren(MarkdownElementChildren Element)
Renders the children of Element .
override string ToString()
Returns the renderer output.
MarkdownDocument Document
Reference to Markdown document being processed.
Helps with common XML-related tasks.
static string HtmlValueEncode(string s)
Differs from Encode(String), in that it does not encode the aposotrophe or the quote.
static string Encode(string s)
Encodes a string for use in XML.
static string HtmlAttributeEncode(string s)
Differs from Encode(String), in that it does not encode the aposotrophe.
Static class managing the application event log. Applications and services log events on this static ...
static Exception UnnestException(Exception Exception)
Unnests an exception, to extract the relevant inner exception.
Node referencing a chunk in a ChunkedList<T>
ChunkNode< T > Next
Next chunk
int Pos
Index after the last element in chunk.
int Start
Index of first element in chunk.
A chunked list is a linked list of chunks of objects of type T .
ChunkNode< T > FirstChunk
First chunk
Class managing a script expression.
string Script
Original script string.
static string ToExpressionString(object Value)
Converts an object to a string, that can be parsed as part of an expression.
Handles two-dimensional graphs.
string Title
Title for graph.
int Width
Width of graph, in pixels. (Default=640 pixels.)
int Height
Height of graph, in pixels. (Default=480 pixels.)
ToMatrix(ScriptNode Operand, bool NullCheck, int Start, int Length, Expression Expression)
To-Matrix operator.
Interface for Emoji sources. Emoji sources provide emojis to content providers.
Task GenerateHTML(StringBuilder Output, EmojiInfo Emoji, bool EmbedImage)
Generates HTML for a given Emoji.
bool EmojiSupported(EmojiInfo Emoji)
If the emoji is supported by the emoji source.
Interface for code content HTML renderers.
Interface for multimedia content HTML renderers.
Interface for objects that can be converted into matrices.
TextAlignment
Text alignment of contents.