3using System.Collections.Generic;
5using System.Threading.Tasks;
79 StringBuilder sb =
null;
85 this.
Output.AppendLine(
"<!DOCTYPE html>");
86 this.
Output.AppendLine(
"<html itemscope itemtype=\"http://schema.org/WebPage\">");
87 this.
Output.AppendLine(
"<head>");
91 foreach (KeyValuePair<string, bool> P
in Values)
94 sb =
new StringBuilder();
104 foreach (KeyValuePair<string, bool> P
in Values)
114 this.
Output.Append(
"<title>");
115 if (
string.IsNullOrEmpty(Title))
118 this.
Output.Append(Title);
119 this.
Output.AppendLine(
"</title>");
121 this.
Output.Append(
"<meta itemprop=\"name\" content=\"");
122 this.
Output.Append(Title);
123 this.
Output.AppendLine(
"\"/>");
125 this.
Output.Append(
"<meta name=\"twitter:title\" content=\"");
126 this.
Output.Append(Title);
127 this.
Output.AppendLine(
"\"/>");
129 this.
Output.Append(
"<meta name=\"og:title\" content=\"");
130 this.
Output.Append(Title);
131 this.
Output.AppendLine(
"\"/>");
134 this.
Output.AppendLine(
"<title> </title>");
138 foreach (KeyValuePair<string, bool> P
in Values)
141 sb =
new StringBuilder();
152 this.
Output.Append(
"<meta itemprop=\"description\" content=\"");
153 this.
Output.Append(Description);
154 this.
Output.AppendLine(
"\"/>");
156 this.
Output.Append(
"<meta name=\"twitter:description\" content=\"");
157 this.
Output.Append(Description);
158 this.
Output.AppendLine(
"\"/>");
160 this.
Output.Append(
"<meta name=\"og:description\" content=\"");
161 this.
Output.Append(Description);
162 this.
Output.AppendLine(
"\"/>");
168 if (sb is
null ||
string.IsNullOrEmpty(s2 = sb.ToString()))
169 sb =
new StringBuilder(
"Author:");
172 char ch = s2[s2.Length - 1];
174 if (!
char.IsPunctuation(ch))
177 sb.Append(
" Author:");
180 foreach (KeyValuePair<string, bool> P
in Values)
189 if (sb is
null ||
string.IsNullOrEmpty(s2 = sb.ToString()))
190 sb =
new StringBuilder(
"Date:");
193 char ch = s2[s2.Length - 1];
195 if (!
char.IsPunctuation(ch))
201 foreach (KeyValuePair<string, bool> P
in Values)
211 this.
Output.AppendLine(
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>");
217 this.
Output.Append(
"<meta name=\"description\" content=\"");
219 this.
Output.AppendLine(
"\"/>");
222 foreach (KeyValuePair<
string, KeyValuePair<string, bool>[]> MetaData
in this.
Document.
MetaData)
224 switch (MetaData.Key)
226 case "ACCESS-CONTROL-ALLOW-ORIGIN":
227 case "ALLOWSCRIPTTAG":
229 case "AUDIOAUTOPLAY":
230 case "AUDIOCONTROLS":
232 case "CONTENT-SECURITY-POLICY":
234 case "CACHE-CONTROL":
246 case "PUBLIC-KEY-PINS":
251 case "STRICT-TRANSPORT-SECURITY":
257 case "VIDEOAUTOPLAY":
258 case "VIDEOCONTROLS":
263 this.
Output.Append(
"<meta name=\"keywords\" content=\"");
265 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
275 this.
Output.AppendLine(
"\"/>");
279 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
281 this.
Output.Append(
"<meta name=\"author\" content=\"");
283 this.
Output.AppendLine(
"\"/>");
288 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
292 this.
Output.Append(
"<meta itemprop=\"image\" content=\"");
294 this.
Output.AppendLine(
"\"/>");
296 this.
Output.Append(
"<meta name=\"twitter:image\" content=\"");
298 this.
Output.AppendLine(
"\"/>");
300 this.
Output.Append(
"<meta name=\"og:image\" content=\"");
302 this.
Output.AppendLine(
"\"/>");
307 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
309 this.
Output.Append(
"<meta name=\"og:url\" content=\"");
311 this.
Output.AppendLine(
"\"/>");
316 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
318 this.
Output.Append(
"<meta http-equiv=\"refresh\" content=\"");
320 this.
Output.AppendLine(
"\"/>");
325 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
327 this.
Output.Append(
"<meta name=\"viewport\" content=\"");
329 this.
Output.AppendLine(
"\"/>");
334 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
336 this.
Output.Append(
"<meta name=\"");
338 this.
Output.Append(
"\" content=\"");
340 this.
Output.AppendLine(
"\"/>");
346 bool HighlightStyle =
false;
348 foreach (KeyValuePair<
string, KeyValuePair<string, bool>[]> MetaData
in this.
Document.
MetaData)
350 switch (MetaData.Key)
353 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
355 this.
Output.Append(
"<link rel=\"copyright\" href=\"");
357 this.
Output.AppendLine(
"\"/>");
363 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
366 this.
Output.Append(
"<link rel=\"prev\" href=\"");
368 this.
Output.AppendLine(
"\"/>");
373 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
375 this.
Output.Append(
"<link rel=\"next\" href=\"");
377 this.
Output.AppendLine(
"\"/>");
382 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
384 this.
Output.Append(
"<link rel=\"alternate\" href=\"");
386 this.
Output.AppendLine(
"\"/>");
391 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
393 this.
Output.Append(
"<link rel=\"help\" href=\"");
395 this.
Output.AppendLine(
"\"/>");
400 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
402 this.
Output.Append(
"<link rel=\"shortcut icon\" href=\"");
404 this.
Output.AppendLine(
"\"/>");
409 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
412 if (s2.StartsWith(
"/Highlight/styles/", StringComparison.OrdinalIgnoreCase))
413 HighlightStyle =
true;
415 this.
Output.Append(
"<link rel=\"stylesheet\" href=\"");
417 this.
Output.AppendLine(
"\"/>");
422 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
424 this.
Output.Append(
"<script type=\"application/javascript\" src=\"");
426 this.
Output.AppendLine(
"\"></script>");
435 this.
Output.AppendLine(
"<link rel=\"stylesheet\" href=\"/highlight/styles/default.css\">");
437 this.
Output.AppendLine(
"<script src=\"/highlight/highlight.pack.js\"></script>");
438 this.
Output.AppendLine(
"<script>hljs.initHighlightingOnLoad();</script>");
441 this.
Output.AppendLine(
"</head>");
442 this.
Output.AppendLine(
"<body>");
444 return Task.CompletedTask;
452 this.
Output.AppendLine(
"<div class=\"footnotes\">");
453 this.
Output.AppendLine(
"<hr />");
454 this.
Output.AppendLine(
"<ol>");
458 if ((this.
Document?.TryGetFootnoteNumber(Key, out
int Nr) ??
false) &&
462 this.
Output.Append(
"<li id=\"fn-");
463 this.
Output.Append(Nr.ToString());
464 this.
Output.Append(
"\">");
466 if (!Footnote.BacklinkAdded)
471 P.AddChildren(Backlink);
475 Footnote.BacklinkAdded =
true;
480 this.
Output.AppendLine(
"</li>");
484 this.
Output.AppendLine(
"</ol>");
485 this.
Output.AppendLine(
"</div>");
493 this.
Output.AppendLine(
"</body>");
494 this.
Output.Append(
"</html>");
496 return Task.CompletedTask;
499 #region Span Elements
507 this.
Output.Append(
"<abbr data-title=\"");
509 this.
Output.Append(
"\">");
513 this.
Output.Append(
"</abbr>");
522 string s = Element.
EMail;
523 byte[] Data = Encoding.ASCII.GetBytes(s);
524 StringBuilder sb =
new StringBuilder();
526 foreach (
byte b
in Data)
529 sb.Append(b.ToString(
"X2"));
536 Data = Encoding.ASCII.GetBytes(
"mailto:");
537 foreach (
byte b
in Data)
540 sb.Append(b.ToString(
"X2"));
544 this.
Output.Append(
"<a href=\"");
545 this.
Output.Append(sb.ToString());
547 this.
Output.Append(
"\">");
549 this.
Output.Append(
"</a>");
551 return Task.CompletedTask;
560 bool IsRelative = Element.
URL.IndexOf(
':') < 0;
562 this.
Output.Append(
"<a href=\"");
566 this.
Output.Append(
"\" target=\"_blank");
568 this.
Output.Append(
"\">");
570 this.
Output.Append(
"</a>");
572 return Task.CompletedTask;
581 this.
Output.Append(
"<del>");
583 this.
Output.Append(
"</del>");
606 if (EmojiSource is
null)
617 return Task.CompletedTask;
626 this.
Output.Append(
"<em>");
628 this.
Output.Append(
"</em>");
643 await this.
Render(Footnote);
644 else if (this.
Document?.TryGetFootnoteNumber(Element.
Key, out
int Nr) ??
false)
648 this.
Output.Append(
"<sup id=\"fnref-");
650 this.
Output.Append(
"\"><a href=\"#fn-");
652 this.
Output.Append(
"\" class=\"footnote-ref\">");
654 this.
Output.Append(
"</a></sup>");
656 if (!(Footnote is
null))
657 Footnote.Referenced =
true;
667 this.
Output.Append(
"<mark");
669 string s = this.htmlSettings?.HashtagClass;
671 if (!
string.IsNullOrEmpty(s))
673 this.
Output.Append(
" class=\"");
678 s = this.htmlSettings?.HashtagClickScript;
680 if (!
string.IsNullOrEmpty(s))
682 this.
Output.Append(
" onclick=\"");
689 this.
Output.Append(
"</mark>");
691 return Task.CompletedTask;
700 if (this.htmlSettings?.XmlEntitiesOnly ??
true)
725 string s = Html.HtmlEntity.EntityToCharacter(Element.
Entity);
726 if (!
string.IsNullOrEmpty(s))
738 return Task.CompletedTask;
751 return Task.CompletedTask;
760 this.
Output.Append(
"<code>");
762 this.
Output.Append(
"</code>");
764 return Task.CompletedTask;
775 return Task.CompletedTask;
800 if (Result is XmlDocument Xml)
805 if (Result is
Graph G)
810 if (AloneInParagraph)
811 this.
Output.Append(
"<figure>");
813 this.
Output.Append(
"<img border=\"2\" width=\"");
814 this.
Output.Append(GraphSettings.Width.ToString());
815 this.
Output.Append(
"\" height=\"");
816 this.
Output.Append(GraphSettings.Height.ToString());
817 this.
Output.Append(
"\" src=\"data:image/png;base64,");
818 this.
Output.Append(Convert.ToBase64String(Bin, 0, Bin.Length));
819 this.
Output.Append(
"\" alt=\"");
824 this.
Output.Append(
"Graph");
826 this.
Output.Append(
"\" />");
828 if (AloneInParagraph)
829 this.
Output.Append(
"</figure>");
833 byte[] Bin = Pixels.EncodeAsPng();
835 if (AloneInParagraph)
836 this.
Output.Append(
"<figure>");
838 this.
Output.Append(
"<img border=\"2\" width=\"");
839 this.
Output.Append(Pixels.Width.ToString());
840 this.
Output.Append(
"\" height=\"");
841 this.
Output.Append(Pixels.Height.ToString());
842 this.
Output.Append(
"\" src=\"data:image/png;base64,");
843 this.
Output.Append(Convert.ToBase64String(Bin, 0, Bin.Length));
844 this.
Output.Append(
"\" alt=\"Image\" />");
846 if (AloneInParagraph)
847 this.
Output.Append(
"</figure>");
849 else if (Result is SKImage Img)
851 using (SKData Data = Img.Encode(SKEncodedImageFormat.Png, 100))
853 byte[] Bin = Data.ToArray();
855 if (AloneInParagraph)
856 this.
Output.Append(
"<figure>");
858 this.
Output.Append(
"<img border=\"2\" width=\"");
859 this.
Output.Append(Img.Width.ToString());
860 this.
Output.Append(
"\" height=\"");
861 this.
Output.Append(Img.Height.ToString());
862 this.
Output.Append(
"\" src=\"data:image/png;base64,");
863 this.
Output.Append(Convert.ToBase64String(Bin, 0, Bin.Length));
864 this.
Output.Append(
"\" alt=\"Image\" />");
866 if (AloneInParagraph)
867 this.
Output.Append(
"</figure>");
873 Doc.ProcessAsyncTasks();
879 Doc.ProcessAsyncTasks();
881 else if (Result is Exception ex)
885 this.
Output.AppendLine(
"<font class=\"error\">");
887 if (ex is AggregateException ex2)
889 foreach (Exception ex3
in ex2.InnerExceptions)
891 this.
Output.Append(
"<p>");
893 this.
Output.AppendLine(
"</p>");
898 if (AloneInParagraph)
899 this.
Output.Append(
"<p>");
903 if (AloneInParagraph)
904 this.
Output.Append(
"</p>");
907 this.
Output.AppendLine(
"</font>");
909 else if (Result is
ObjectMatrix M && !(M.ColumnNames is
null))
911 this.
Output.Append(
"<table><thead><tr>");
913 foreach (
string s2
in M.ColumnNames)
915 this.
Output.Append(
"<th>");
917 this.
Output.Append(
"</th>");
920 this.
Output.Append(
"</tr></thead><tbody>");
924 for (y = 0; y < M.Rows; y++)
926 this.
Output.Append(
"<tr>");
928 for (x = 0; x < M.Columns; x++)
930 this.
Output.Append(
"<td>");
932 object Item = M.GetElement(x, y).AssociatedObjectValue;
935 if (Item is
string s2)
938 await Element.Render(
this);
943 this.
Output.Append(
"</td>");
946 this.
Output.Append(
"</tr>");
949 this.
Output.Append(
"</tbody></table>");
951 else if (Result is Array A)
953 foreach (
object Item
in A)
958 if (AloneInParagraph)
959 this.
Output.Append(
"<p>");
963 if (AloneInParagraph)
964 this.
Output.Append(
"</p>");
967 if (AloneInParagraph)
971 private static string FormatText(
string s)
973 return s.Replace(
"\r\n",
"\n").Replace(
"\n",
"<br/>").Replace(
"\r",
"<br/>").
974 Replace(
"\t",
" ").Replace(
" ",
" ");
985 return Task.CompletedTask;
994 this.
Output.Append(
"<ins>");
996 this.
Output.Append(
"</ins>");
1005 this.
Output.AppendLine(
"<br/>");
1007 return Task.CompletedTask;
1028 bool IsRelative = Url.IndexOf(
':') < 0;
1030 if (!IsRelative && Url.StartsWith(
"javascript:", StringComparison.OrdinalIgnoreCase))
1032 this.
Output.Append(
"<a href=\"#\" onclick=\"");
1038 this.
Output.Append(
"<a href=\"");
1042 if (!
string.IsNullOrEmpty(Title))
1044 this.
Output.Append(
"\" title=\"");
1049 this.
Output.Append(
"\" target=\"_blank");
1051 this.
Output.Append(
"\">");
1056 this.
Output.Append(
"</a>");
1079 bool FirstOnRow =
true;
1081 if (Element.
TryGetMetaData(out KeyValuePair<string, bool>[] Values))
1083 foreach (KeyValuePair<string, bool> P
in Values)
1093 this.
Output.AppendLine(
"<br/>");
1099 return Task.CompletedTask;
1106 public override Task
Render(Model.SpanElements.Multimedia Element)
1112 return Renderer.RenderHtml(
this, Element.Items, Element.Children, Element.AloneInParagraph, Element.Document);
1139 this.
Output.Append(
"<s>");
1141 this.
Output.Append(
"</s>");
1150 this.
Output.Append(
"<strong>");
1152 this.
Output.Append(
"</strong>");
1161 this.
Output.Append(
"<sub>");
1163 this.
Output.Append(
"</sub>");
1172 this.
Output.Append(
"<sup>");
1174 this.
Output.Append(
"</sup>");
1183 this.
Output.Append(
"<u>");
1185 this.
Output.Append(
"</u>");
1190 #region Block elements
1198 this.
Output.AppendLine(
"<blockquote>");
1200 this.
Output.AppendLine(
"</blockquote>");
1209 this.
Output.AppendLine(
"<ul>");
1211 this.
Output.AppendLine(
"</ul>");
1220 this.
Output.AppendLine(
"<div class='horizontalAlignCenter'>");
1222 this.
Output.AppendLine(
"</div>");
1240 catch (Exception ex)
1244 this.
Output.AppendLine(
"<font class=\"error\">");
1246 if (ex is AggregateException ex2)
1248 foreach (Exception ex3
in ex2.InnerExceptions)
1250 this.
Output.Append(
"<p>");
1252 this.
Output.AppendLine(
"</p>");
1257 this.
Output.Append(
"<p>");
1259 this.
Output.Append(
"</p>");
1262 this.
Output.Append(
"</font>");
1268 this.
Output.Append(
"<pre><code class=\"");
1270 if (
string.IsNullOrEmpty(Element.
Language))
1271 this.
Output.Append(
"nohighlight");
1275 this.
Output.Append(
"\">");
1277 for (i = Element.
Start; i <= Element.
End; i++)
1283 this.
Output.AppendLine(
"</code></pre>");
1292 return Task.CompletedTask;
1303 this.
Output.Append(
"<dd>");
1305 this.
Output.AppendLine(
"</dd>");
1315 this.
Output.AppendLine(
"<dl>");
1317 this.
Output.AppendLine(
"</dl>");
1328 this.
Output.Append(
"<dt>");
1330 this.
Output.AppendLine(
"</dt>");
1340 this.
Output.AppendLine(
"<blockquote class=\"deleted\">");
1345 this.
Output.AppendLine(
"</blockquote>");
1363 this.
Output.Append(
"<h");
1366 string Id = await Element.
Id;
1368 if (!
string.IsNullOrEmpty(Id))
1370 this.
Output.Append(
" id=\"");
1372 this.
Output.Append(
"\"");
1376 this.
Output.Append(
" class=\"tocReference\"");
1382 this.
Output.Append(
"</h");
1384 this.
Output.AppendLine(
">");
1393 this.
Output.AppendLine(
"<hr/>");
1395 return Task.CompletedTask;
1405 this.
Output.AppendLine();
1414 this.
Output.AppendLine(
"<blockquote class=\"inserted\">");
1416 this.
Output.AppendLine(
"</blockquote>");
1425 return Task.CompletedTask;
1434 this.
Output.AppendLine(
"<div class='horizontalAlignLeft'>");
1436 this.
Output.AppendLine(
"</div>");
1445 this.
Output.AppendLine(
"<div class='horizontalAlignMargins'>");
1447 this.
Output.AppendLine(
"</div>");
1467 this.
Output.Append(
"<li value=\"");
1469 this.
Output.Append(
"\">");
1472 this.
Output.Append(
"<li>");
1476 this.
Output.AppendLine(
"</li>");
1488 this.
Output.AppendLine(
"<ol>");
1497 else if (Item.Number == Expected)
1499 this.
Output.Append(
"<li>");
1500 await Item.Child.Render(
this);
1501 this.
Output.AppendLine(
"</li>");
1505 await Item.Render(
this);
1506 Expected = Item.Number;
1510 this.
Output.AppendLine(
"</ol>");
1520 this.
Output.Append(
"<p>");
1525 this.
Output.AppendLine(
"</p>");
1534 this.
Output.AppendLine(
"<div class='horizontalAlignRight'>");
1536 this.
Output.AppendLine(
"</div>");
1547 this.
Output.AppendLine(
"</section>");
1550 private void GenerateSectionHTML(
int NrColumns)
1552 this.
Output.Append(
"<section");
1556 string s = NrColumns.ToString();
1558 this.
Output.Append(
" style=\"-webkit-column-count:");
1560 this.
Output.Append(
";-moz-column-count:");
1562 this.
Output.Append(
";column-count:");
1567 this.
Output.AppendLine(
">");
1576 this.
Output.AppendLine(
"</section>");
1577 this.GenerateSectionHTML(Element.
NrColumns);
1579 return Task.CompletedTask;
1591 int NrRows, RowIndex;
1592 int NrColumns = Element.
Columns;
1595 this.
Output.AppendLine(
"<table>");
1597 if (!
string.IsNullOrEmpty(Element.
Id))
1599 this.
Output.Append(
"<caption id=\"");
1601 this.
Output.Append(
"\">");
1603 if (
string.IsNullOrEmpty(Element.
Caption))
1608 this.
Output.AppendLine(
"</caption>");
1611 this.
Output.AppendLine(
"<colgroup>");
1612 foreach (
TextAlignment Alignment
in Element.ColumnAlignments)
1614 this.
Output.Append(
"<col style=\"text-align:");
1615 this.
Output.Append(Alignment.ToString().ToLower());
1616 this.
Output.AppendLine(
"\"/>");
1618 this.
Output.AppendLine(
"</colgroup>");
1620 this.
Output.AppendLine(
"<thead>");
1622 NrRows = Element.Headers.Length;
1623 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1625 Row = Element.Headers[RowIndex];
1626 CellAlignments = Element.HeaderCellAlignments[RowIndex];
1628 this.
Output.AppendLine(
"<tr>");
1630 for (i = 0; i < NrColumns; i++)
1638 while (j < NrColumns && Row[j++] is
null)
1641 this.
Output.Append(
"<th style=\"text-align:");
1642 this.
Output.Append((CellAlignments[i] ?? Element.ColumnAlignments[i]).ToString().ToLower());
1646 this.
Output.Append(
"\" colspan=\"");
1647 this.
Output.Append(k.ToString());
1650 this.
Output.Append(
"\">");
1652 this.
Output.AppendLine(
"</th>");
1655 this.
Output.AppendLine(
"</tr>");
1657 this.
Output.AppendLine(
"</thead>");
1659 this.
Output.AppendLine(
"<tbody>");
1661 NrRows = Element.Rows.Length;
1662 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1664 Row = Element.Rows[RowIndex];
1665 CellAlignments = Element.RowCellAlignments[RowIndex];
1667 this.
Output.AppendLine(
"<tr>");
1669 for (i = 0; i < NrColumns; i++)
1677 while (j < NrColumns && Row[j++] is
null)
1680 this.
Output.Append(
"<td style=\"text-align:");
1681 this.
Output.Append((CellAlignments[i] ?? Element.ColumnAlignments[i]).ToString().ToLower());
1685 this.
Output.Append(
"\" colspan=\"");
1686 this.
Output.Append(k.ToString());
1689 this.
Output.Append(
"\">");
1691 this.
Output.AppendLine(
"</td>");
1694 this.
Output.AppendLine(
"</tr>");
1696 this.
Output.AppendLine(
"</tbody>");
1698 this.
Output.AppendLine(
"</table>");
1707 this.
Output.Append(
"<li class=\"taskListItem\"><input disabled=\"disabled");
1711 this.
Output.Append(
"\" id=\"item");
1713 this.
Output.Append(
"\" data-position=\"");
1717 this.
Output.Append(
"\" type=\"checkbox\"");
1720 this.
Output.Append(
" checked=\"checked\"");
1722 this.
Output.Append(
"/><span></span><label class=\"taskListItemLabel\"");
1726 this.
Output.Append(
" for=\"item");
1728 this.
Output.Append(
"\"");
1735 bool EndLabel =
true;
1756 this.
Output.Append(
"</label>");
1765 this.
Output.Append(
"</label>");
1767 this.
Output.AppendLine(
"</li>");
1772 this.
Output.AppendLine(
"</label></li>");
1782 this.
Output.AppendLine(
"<ul class=\"taskList\">");
1784 this.
Output.AppendLine(
"</ul>");
1793 this.
Output.Append(
"<li");
1797 if (!(Detail is
null))
1802 this.
Output.Append(
" class=\"active\"");
1812 this.
Output.Append(
" class=\"active\"");
1819 this.
Output.AppendLine(
"</li>");
string ShortName
Emoji short name.
string Unicode
Unicode representation of emoji.
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.
bool SyntaxHighlighting
If syntax highlighting is used in the document.
IEnumerable< KeyValuePair< string, KeyValuePair< string, bool >[]> > MetaData
Meta-data
bool TryGetMetaData(string Key, out KeyValuePair< string, bool >[] Value)
Tries to get a meta-data value given its key.
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...
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,...
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.
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.
string Caption
Table caption.
int Columns
Number of columns.
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.
override IEnumerable< MarkdownElement > Children
Any children of the element.
MarkdownElement LastChild
Last child, or null if none.
void AddChildren(params MarkdownElement[] NewChildren)
Adds children to the element.
Abstract base class for all markdown elements.
abstract Task Render(IRenderer Output)
Renders the element.
virtual IEnumerable< MarkdownElement > Children
Any children of 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
bool AloneInParagraph
If the element is alone in a paragraph.
Variables Variables
Variables.
async Task< object > EvaluateExpression()
Evaluates the script 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.
Renders HTML from a Markdown document.
override async Task Render(BlockQuote Element)
Renders Element .
override async Task Render(Sections Element)
Renders Element .
override async Task Render(DeleteBlocks Element)
Renders Element .
override Task RenderDocumentFooter()
Renders the document header.
override Task Render(SectionSeparator Element)
Renders Element .
override async Task Render(Insert Element)
Renders Element .
override async Task Render(FootnoteReference Element)
Renders Element .
override async Task Render(UnnumberedItem Element)
Renders Element .
override Task Render(DetailsReference Element)
Renders Element .
override async Task Render(NumberedList Element)
Renders Element .
override async Task Render(InsertBlocks Element)
Renders Element .
override Task Render(CommentBlock Element)
Renders Element .
override Task Render(NestedBlock Element)
Renders Element .
HtmlRenderer(StringBuilder Output, HtmlSettings HtmlSettings)
Renders HTML from a Markdown document.
override Task Render(Link Element)
Renders Element .
override async Task Render(RightAligned Element)
Renders Element .
override async Task Render(DefinitionTerms Element)
Renders Element .
async Task RenderObject(object Result, bool AloneInParagraph, Variables Variables)
Generates HTML from Script output.
override Task Render(InlineText Element)
Renders Element .
override async Task Render(HtmlBlock Element)
Renders Element .
override async Task Render(LeftAligned Element)
Renders Element .
override async Task Render(SuperScript Element)
Renders Element .
override Task Render(LinkReference Element)
Renders Element .
override async Task Render(CodeBlock Element)
Renders Element .
override async Task Render(DefinitionDescriptions Element)
Renders Element .
override Task Render(HtmlEntity Element)
Renders Element .
override async Task Render(Table Element)
Renders Element .
override async Task Render(Strong Element)
Renders Element .
override Task Render(HtmlEntityUnicode Element)
Renders Element .
override Task Render(AutomaticLinkMail Element)
Renders Element .
override async Task RenderFootnotes()
Renders footnotes.
override async Task Render(Emphasize Element)
Renders Element .
override Task Render(EmojiReference Element)
Renders Element .
override async Task Render(Header Element)
Renders Element .
override Task Render(InlineCode Element)
Renders Element .
readonly HtmlSettings htmlSettings
HTML settings.
HtmlRenderer(HtmlSettings HtmlSettings, MarkdownDocument Document)
Renders HTML from a Markdown document.
override async Task Render(InlineScript Element)
Renders Element .
override Task Render(MetaReference Element)
Renders Element .
override Task Render(MultimediaReference Element)
Renders Element .
override Task Render(HashTag Element)
Renders Element .
override async Task Render(DefinitionList Element)
Renders Element .
override async Task Render(BulletList Element)
Renders Element .
override Task Render(InlineHTML Element)
Renders Element .
HtmlRenderer(StringBuilder Output, HtmlSettings HtmlSettings, MarkdownDocument Document)
Renders HTML from a Markdown document.
override async Task Render(MarginAligned Element)
Renders Element .
override async Task Render(Delete Element)
Renders Element .
override async Task Render(Paragraph Element)
Renders Element .
override Task Render(Model.SpanElements.Multimedia Element)
Renders Element .
override Task Render(AutomaticLinkUrl Element)
Renders Element .
override async Task Render(CenterAligned Element)
Renders Element .
async Task Render(string Url, string Title, IEnumerable< MarkdownElement > ChildNodes, MarkdownDocument Document)
Generates HTML for a link.
override Task Render(Footnote Element)
Renders Element .
override async Task Render(Underline Element)
Renders Element .
override async Task Render(SubScript Element)
Renders Element .
override async Task Render(TaskItem Element)
Renders Element .
override Task RenderDocumentHeader()
Renders the document header.
override async Task Render(TaskList Element)
Renders Element .
override async Task Render(NumberedItem Element)
Renders Element .
override async Task Render(Abbreviation Element)
Renders Element .
HtmlRenderer(HtmlSettings HtmlSettings)
Renders HTML from a Markdown document.
override async Task Render(StrikeThrough Element)
Renders Element .
override Task Render(HorizontalRule Element)
Renders Element .
override Task Render(InvisibleBreak Element)
Renders Element .
override Task Render(LineBreak Element)
Renders Element .
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 .
async Task RenderChildren(MarkdownElementChildren Element)
Renders the children of Element .
virtual async Task RenderDocument(MarkdownDocument Document, bool Inclusion)
Renders a document.
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.
Class managing a script expression.
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Handles two-dimensional graphs.
string Title
Title for graph.
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.