5using System.Threading.Tasks;
80 StringBuilder sb =
null;
86 this.
Output.AppendLine(
"<!DOCTYPE html>");
87 this.
Output.AppendLine(
"<html itemscope itemtype=\"http://schema.org/WebPage\">");
88 this.
Output.AppendLine(
"<head>");
92 foreach (KeyValuePair<string, bool> P
in Values)
95 sb =
new StringBuilder();
105 foreach (KeyValuePair<string, bool> P
in Values)
115 this.
Output.Append(
"<title>");
116 if (
string.IsNullOrEmpty(Title))
119 this.
Output.Append(Title);
120 this.
Output.AppendLine(
"</title>");
122 this.
Output.Append(
"<meta itemprop=\"name\" content=\"");
123 this.
Output.Append(Title);
124 this.
Output.AppendLine(
"\"/>");
126 this.
Output.Append(
"<meta name=\"twitter:title\" content=\"");
127 this.
Output.Append(Title);
128 this.
Output.AppendLine(
"\"/>");
130 this.
Output.Append(
"<meta name=\"og:title\" content=\"");
131 this.
Output.Append(Title);
132 this.
Output.AppendLine(
"\"/>");
135 this.
Output.AppendLine(
"<title> </title>");
139 foreach (KeyValuePair<string, bool> P
in Values)
142 sb =
new StringBuilder();
153 this.
Output.Append(
"<meta itemprop=\"description\" content=\"");
154 this.
Output.Append(Description);
155 this.
Output.AppendLine(
"\"/>");
157 this.
Output.Append(
"<meta name=\"twitter:description\" content=\"");
158 this.
Output.Append(Description);
159 this.
Output.AppendLine(
"\"/>");
161 this.
Output.Append(
"<meta name=\"og:description\" content=\"");
162 this.
Output.Append(Description);
163 this.
Output.AppendLine(
"\"/>");
169 if (sb is
null ||
string.IsNullOrEmpty(s2 = sb.ToString()))
170 sb =
new StringBuilder(
"Author:");
173 char ch = s2[s2.Length - 1];
175 if (!
char.IsPunctuation(ch))
178 sb.Append(
" Author:");
181 foreach (KeyValuePair<string, bool> P
in Values)
190 if (sb is
null ||
string.IsNullOrEmpty(s2 = sb.ToString()))
191 sb =
new StringBuilder(
"Date:");
194 char ch = s2[s2.Length - 1];
196 if (!
char.IsPunctuation(ch))
202 foreach (KeyValuePair<string, bool> P
in Values)
212 this.
Output.AppendLine(
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>");
218 this.
Output.Append(
"<meta name=\"description\" content=\"");
220 this.
Output.AppendLine(
"\"/>");
223 foreach (KeyValuePair<
string, KeyValuePair<string, bool>[]> MetaData
in this.
Document.
MetaData)
225 switch (MetaData.Key)
227 case "ACCESS-CONTROL-ALLOW-ORIGIN":
228 case "ALLOWSCRIPTTAG":
230 case "AUDIOAUTOPLAY":
231 case "AUDIOCONTROLS":
233 case "CONTENT-SECURITY-POLICY":
235 case "CACHE-CONTROL":
247 case "PUBLIC-KEY-PINS":
252 case "STRICT-TRANSPORT-SECURITY":
258 case "VIDEOAUTOPLAY":
259 case "VIDEOCONTROLS":
264 this.
Output.Append(
"<meta name=\"keywords\" content=\"");
266 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
276 this.
Output.AppendLine(
"\"/>");
280 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
282 this.
Output.Append(
"<meta name=\"author\" content=\"");
284 this.
Output.AppendLine(
"\"/>");
289 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
293 this.
Output.Append(
"<meta itemprop=\"image\" content=\"");
295 this.
Output.AppendLine(
"\"/>");
297 this.
Output.Append(
"<meta name=\"twitter:image\" content=\"");
299 this.
Output.AppendLine(
"\"/>");
301 this.
Output.Append(
"<meta name=\"og:image\" content=\"");
303 this.
Output.AppendLine(
"\"/>");
308 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
310 this.
Output.Append(
"<meta name=\"og:url\" content=\"");
312 this.
Output.AppendLine(
"\"/>");
317 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
319 this.
Output.Append(
"<meta http-equiv=\"refresh\" content=\"");
321 this.
Output.AppendLine(
"\"/>");
326 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
328 this.
Output.Append(
"<meta name=\"viewport\" content=\"");
330 this.
Output.AppendLine(
"\"/>");
335 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
337 this.
Output.Append(
"<meta name=\"");
339 this.
Output.Append(
"\" content=\"");
341 this.
Output.AppendLine(
"\"/>");
347 bool HighlightStyle =
false;
349 foreach (KeyValuePair<
string, KeyValuePair<string, bool>[]> MetaData
in this.
Document.
MetaData)
351 switch (MetaData.Key)
354 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
356 this.
Output.Append(
"<link rel=\"copyright\" href=\"");
358 this.
Output.AppendLine(
"\"/>");
364 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
367 this.
Output.Append(
"<link rel=\"prev\" href=\"");
369 this.
Output.AppendLine(
"\"/>");
374 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
376 this.
Output.Append(
"<link rel=\"next\" href=\"");
378 this.
Output.AppendLine(
"\"/>");
383 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
385 this.
Output.Append(
"<link rel=\"alternate\" href=\"");
387 this.
Output.AppendLine(
"\"/>");
392 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
394 this.
Output.Append(
"<link rel=\"help\" href=\"");
396 this.
Output.AppendLine(
"\"/>");
401 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
403 this.
Output.Append(
"<link rel=\"shortcut icon\" href=\"");
405 this.
Output.AppendLine(
"\"/>");
410 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
413 if (s2.StartsWith(
"/Highlight/styles/", StringComparison.OrdinalIgnoreCase))
414 HighlightStyle =
true;
416 this.
Output.Append(
"<link rel=\"stylesheet\" href=\"");
418 this.
Output.AppendLine(
"\"/>");
423 foreach (KeyValuePair<string, bool> P
in MetaData.Value)
425 this.
Output.Append(
"<script type=\"application/javascript\" src=\"");
427 this.
Output.AppendLine(
"\"></script>");
436 this.
Output.AppendLine(
"<link rel=\"stylesheet\" href=\"/highlight/styles/default.css\">");
438 this.
Output.AppendLine(
"<script src=\"/highlight/highlight.pack.js\"></script>");
439 this.
Output.AppendLine(
"<script>hljs.initHighlightingOnLoad();</script>");
442 this.
Output.AppendLine(
"</head>");
443 this.
Output.AppendLine(
"<body>");
445 return Task.CompletedTask;
453 this.
Output.AppendLine(
"<div class=\"footnotes\">");
454 this.
Output.AppendLine(
"<hr />");
455 this.
Output.AppendLine(
"<ol>");
459 if ((this.
Document?.TryGetFootnoteNumber(Key, out
int Nr) ??
false) &&
463 this.
Output.Append(
"<li id=\"fn-");
464 this.
Output.Append(Nr.ToString());
465 this.
Output.Append(
"\">");
467 if (!Footnote.BacklinkAdded)
472 P.AddChild(Backlink);
476 Footnote.BacklinkAdded =
true;
481 this.
Output.AppendLine(
"</li>");
485 this.
Output.AppendLine(
"</ol>");
486 this.
Output.AppendLine(
"</div>");
494 this.
Output.AppendLine(
"</body>");
495 this.
Output.Append(
"</html>");
497 return Task.CompletedTask;
500 #region Span Elements
508 this.
Output.Append(
"<abbr data-title=\"");
510 this.
Output.Append(
"\">");
514 this.
Output.Append(
"</abbr>");
523 string s = Element.
EMail;
524 byte[] Data = Encoding.ASCII.GetBytes(s);
525 StringBuilder sb =
new StringBuilder();
527 foreach (
byte b
in Data)
530 sb.Append(b.ToString(
"X2"));
537 Data = Encoding.ASCII.GetBytes(
"mailto:");
538 foreach (
byte b
in Data)
541 sb.Append(b.ToString(
"X2"));
545 this.
Output.Append(
"<a href=\"");
546 this.
Output.Append(sb.ToString());
548 this.
Output.Append(
"\">");
550 this.
Output.Append(
"</a>");
552 return Task.CompletedTask;
561 bool IsRelative = Element.
URL.IndexOf(
':') < 0;
563 this.
Output.Append(
"<a href=\"");
567 this.
Output.Append(
"\" target=\"_blank");
569 this.
Output.Append(
"\">");
571 this.
Output.Append(
"</a>");
573 return Task.CompletedTask;
582 this.
Output.Append(
"<del>");
584 this.
Output.Append(
"</del>");
607 if (EmojiSource is
null)
618 return Task.CompletedTask;
627 this.
Output.Append(
"<em>");
629 this.
Output.Append(
"</em>");
644 await this.
Render(Footnote);
645 else if (this.
Document?.TryGetFootnoteNumber(Element.
Key, out
int Nr) ??
false)
649 this.
Output.Append(
"<sup id=\"fnref-");
651 this.
Output.Append(
"\"><a href=\"#fn-");
653 this.
Output.Append(
"\" class=\"footnote-ref\">");
655 this.
Output.Append(
"</a></sup>");
657 if (!(Footnote is
null))
658 Footnote.Referenced =
true;
668 this.
Output.Append(
"<mark");
670 string s = this.htmlSettings?.HashtagClass;
672 if (!
string.IsNullOrEmpty(s))
674 this.
Output.Append(
" class=\"");
679 s = this.htmlSettings?.HashtagClickScript;
681 if (!
string.IsNullOrEmpty(s))
683 this.
Output.Append(
" onclick=\"");
690 this.
Output.Append(
"</mark>");
692 return Task.CompletedTask;
701 if (this.htmlSettings?.XmlEntitiesOnly ??
true)
726 string s = Html.HtmlEntity.EntityToCharacter(Element.
Entity);
727 if (!
string.IsNullOrEmpty(s))
739 return Task.CompletedTask;
752 return Task.CompletedTask;
761 this.
Output.Append(
"<code>");
763 this.
Output.Append(
"</code>");
765 return Task.CompletedTask;
776 return Task.CompletedTask;
801 if (Result is XmlDocument Xml)
806 if (Result is
Graph G)
811 if (AloneInParagraph)
812 this.
Output.Append(
"<figure>");
814 this.
Output.Append(
"<img border=\"2\" width=\"");
816 this.
Output.Append(
"\" height=\"");
818 this.
Output.Append(
"\" src=\"data:image/png;base64,");
819 this.
Output.Append(Convert.ToBase64String(Bin, 0, Bin.Length));
820 this.
Output.Append(
"\" alt=\"");
825 this.
Output.Append(
"Graph");
827 this.
Output.Append(
"\" />");
829 if (AloneInParagraph)
830 this.
Output.Append(
"</figure>");
834 byte[] Bin = Pixels.EncodeAsPng();
836 if (AloneInParagraph)
837 this.
Output.Append(
"<figure>");
839 this.
Output.Append(
"<img border=\"2\" width=\"");
840 this.
Output.Append(Pixels.Width.ToString());
841 this.
Output.Append(
"\" height=\"");
842 this.
Output.Append(Pixels.Height.ToString());
843 this.
Output.Append(
"\" src=\"data:image/png;base64,");
844 this.
Output.Append(Convert.ToBase64String(Bin, 0, Bin.Length));
845 this.
Output.Append(
"\" alt=\"Image\" />");
847 if (AloneInParagraph)
848 this.
Output.Append(
"</figure>");
850 else if (Result is SKImage Img)
852 using (SKData Data = Img.Encode(SKEncodedImageFormat.Png, 100))
854 byte[] Bin = Data.ToArray();
856 if (AloneInParagraph)
857 this.
Output.Append(
"<figure>");
859 this.
Output.Append(
"<img border=\"2\" width=\"");
860 this.
Output.Append(Img.Width.ToString());
861 this.
Output.Append(
"\" height=\"");
862 this.
Output.Append(Img.Height.ToString());
863 this.
Output.Append(
"\" src=\"data:image/png;base64,");
864 this.
Output.Append(Convert.ToBase64String(Bin, 0, Bin.Length));
865 this.
Output.Append(
"\" alt=\"Image\" />");
867 if (AloneInParagraph)
868 this.
Output.Append(
"</figure>");
874 Doc.ProcessAsyncTasks();
880 Doc.ProcessAsyncTasks();
882 else if (Result is Exception ex)
886 this.
Output.AppendLine(
"<font class=\"error\">");
888 if (ex is AggregateException ex2)
890 foreach (Exception ex3
in ex2.InnerExceptions)
892 this.
Output.Append(
"<p>");
894 this.
Output.AppendLine(
"</p>");
899 if (AloneInParagraph)
900 this.
Output.Append(
"<p>");
904 if (AloneInParagraph)
905 this.
Output.Append(
"</p>");
908 this.
Output.AppendLine(
"</font>");
910 else if (Result is
ObjectMatrix M && !(M.ColumnNames is
null))
912 this.
Output.Append(
"<table><thead><tr>");
914 foreach (
string s2
in M.ColumnNames)
916 this.
Output.Append(
"<th>");
918 this.
Output.Append(
"</th>");
921 this.
Output.Append(
"</tr></thead><tbody>");
925 for (y = 0; y < M.Rows; y++)
927 this.
Output.Append(
"<tr>");
929 for (x = 0; x < M.Columns; x++)
931 this.
Output.Append(
"<td>");
933 object Item = M.GetElement(x, y).AssociatedObjectValue;
936 if (Item is
string s2)
939 await Element.Render(
this);
944 this.
Output.Append(
"</td>");
947 this.
Output.Append(
"</tr>");
950 this.
Output.Append(
"</tbody></table>");
952 else if (Result is Array A)
954 foreach (
object Item
in A)
959 if (AloneInParagraph)
960 this.
Output.Append(
"<p>");
964 if (AloneInParagraph)
965 this.
Output.Append(
"</p>");
968 if (AloneInParagraph)
972 private static string FormatText(
string s)
974 return s.Replace(
"\r\n",
"\n").Replace(
"\n",
"<br/>").Replace(
"\r",
"<br/>").
975 Replace(
"\t",
" ").Replace(
" ",
" ");
986 return Task.CompletedTask;
995 this.
Output.Append(
"<ins>");
997 this.
Output.Append(
"</ins>");
1006 this.
Output.AppendLine(
"<br/>");
1008 return Task.CompletedTask;
1029 bool IsRelative = Url.IndexOf(
':') < 0;
1031 if (!IsRelative && Url.StartsWith(
"javascript:", StringComparison.OrdinalIgnoreCase))
1033 this.
Output.Append(
"<a href=\"#\" onclick=\"");
1039 this.
Output.Append(
"<a href=\"");
1043 if (!
string.IsNullOrEmpty(Title))
1045 this.
Output.Append(
"\" title=\"");
1050 this.
Output.Append(
"\" target=\"_blank");
1052 this.
Output.Append(
"\">");
1053 await this.
Render(ChildNodes);
1054 this.
Output.Append(
"</a>");
1077 bool FirstOnRow =
true;
1079 if (Element.
TryGetMetaData(out KeyValuePair<string, bool>[] Values))
1081 foreach (KeyValuePair<string, bool> P
in Values)
1091 this.
Output.AppendLine(
"<br/>");
1097 return Task.CompletedTask;
1104 public override Task
Render(Model.SpanElements.Multimedia Element)
1110 return Renderer.RenderHtml(
this, Element.Items, Element.Children, Element.AloneInParagraph, Element.Document);
1137 this.
Output.Append(
"<s>");
1139 this.
Output.Append(
"</s>");
1148 this.
Output.Append(
"<strong>");
1150 this.
Output.Append(
"</strong>");
1159 this.
Output.Append(
"<sub>");
1161 this.
Output.Append(
"</sub>");
1170 this.
Output.Append(
"<sup>");
1172 this.
Output.Append(
"</sup>");
1181 this.
Output.Append(
"<u>");
1183 this.
Output.Append(
"</u>");
1188 #region Block elements
1196 this.
Output.AppendLine(
"<blockquote>");
1198 this.
Output.AppendLine(
"</blockquote>");
1207 this.
Output.AppendLine(
"<ul>");
1209 this.
Output.AppendLine(
"</ul>");
1218 this.
Output.AppendLine(
"<div class='horizontalAlignCenter'>");
1220 this.
Output.AppendLine(
"</div>");
1238 catch (Exception ex)
1242 this.
Output.AppendLine(
"<font class=\"error\">");
1244 if (ex is AggregateException ex2)
1246 foreach (Exception ex3
in ex2.InnerExceptions)
1248 this.
Output.Append(
"<p>");
1250 this.
Output.AppendLine(
"</p>");
1255 this.
Output.Append(
"<p>");
1257 this.
Output.Append(
"</p>");
1260 this.
Output.Append(
"</font>");
1266 this.
Output.Append(
"<pre><code class=\"");
1268 if (
string.IsNullOrEmpty(Element.
Language))
1269 this.
Output.Append(
"nohighlight");
1273 this.
Output.Append(
"\">");
1275 for (i = Element.
Start; i <= Element.
End; i++)
1281 this.
Output.AppendLine(
"</code></pre>");
1290 return Task.CompletedTask;
1302 while (!(Loop is
null))
1304 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1306 this.
Output.Append(
"<dd>");
1307 await Loop[i].Render(
this);
1308 this.
Output.AppendLine(
"</dd>");
1321 this.
Output.AppendLine(
"<dl>");
1323 this.
Output.AppendLine(
"</dl>");
1335 while (!(Loop is
null))
1337 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1339 this.
Output.Append(
"<dt>");
1340 await Loop[i].Render(
this);
1341 this.
Output.AppendLine(
"</dt>");
1354 this.
Output.AppendLine(
"<blockquote class=\"deleted\">");
1356 this.
Output.AppendLine(
"</blockquote>");
1374 this.
Output.Append(
"<h");
1377 string Id = await Element.
Id;
1379 if (!
string.IsNullOrEmpty(Id))
1381 this.
Output.Append(
" id=\"");
1387 this.
Output.Append(
" class=\"tocReference\"");
1393 this.
Output.Append(
"</h");
1395 this.
Output.AppendLine(
">");
1404 this.
Output.AppendLine(
"<hr/>");
1406 return Task.CompletedTask;
1416 this.
Output.AppendLine();
1425 this.
Output.AppendLine(
"<blockquote class=\"inserted\">");
1427 this.
Output.AppendLine(
"</blockquote>");
1436 return Task.CompletedTask;
1445 this.
Output.AppendLine(
"<div class='horizontalAlignLeft'>");
1447 this.
Output.AppendLine(
"</div>");
1456 this.
Output.AppendLine(
"<div class='horizontalAlignMargins'>");
1458 this.
Output.AppendLine(
"</div>");
1478 this.
Output.Append(
"<li value=\"");
1480 this.
Output.Append(
"\">");
1483 this.
Output.Append(
"<li>");
1487 this.
Output.AppendLine(
"</li>");
1502 this.
Output.AppendLine(
"<ol>");
1504 while (!(Loop is
null))
1506 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1514 else if (Item.
Number == Expected)
1516 this.
Output.Append(
"<li>");
1518 this.
Output.AppendLine(
"</li>");
1530 this.
Output.AppendLine(
"</ol>");
1540 this.
Output.Append(
"<p>");
1545 this.
Output.AppendLine(
"</p>");
1554 this.
Output.AppendLine(
"<div class='horizontalAlignRight'>");
1556 this.
Output.AppendLine(
"</div>");
1567 this.
Output.AppendLine(
"</section>");
1570 private void GenerateSectionHTML(
int NrColumns)
1572 this.
Output.Append(
"<section");
1576 string s = NrColumns.ToString();
1578 this.
Output.Append(
" style=\"-webkit-column-count:");
1580 this.
Output.Append(
";-moz-column-count:");
1582 this.
Output.Append(
";column-count:");
1587 this.
Output.AppendLine(
">");
1596 this.
Output.AppendLine(
"</section>");
1597 this.GenerateSectionHTML(Element.
NrColumns);
1599 return Task.CompletedTask;
1611 int NrRows, RowIndex;
1612 int NrColumns = Element.
Columns;
1615 this.
Output.AppendLine(
"<table>");
1617 if (!
string.IsNullOrEmpty(Element.
Id))
1619 this.
Output.Append(
"<caption id=\"");
1621 this.
Output.Append(
"\">");
1623 if (
string.IsNullOrEmpty(Element.
Caption))
1628 this.
Output.AppendLine(
"</caption>");
1631 this.
Output.AppendLine(
"<colgroup>");
1632 foreach (
TextAlignment Alignment
in Element.ColumnAlignments)
1634 this.
Output.Append(
"<col style=\"text-align:");
1635 this.
Output.Append(Alignment.ToString().ToLower());
1636 this.
Output.AppendLine(
"\"/>");
1638 this.
Output.AppendLine(
"</colgroup>");
1640 this.
Output.AppendLine(
"<thead>");
1642 NrRows = Element.Headers.Length;
1643 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1645 Row = Element.Headers[RowIndex];
1646 CellAlignments = Element.HeaderCellAlignments[RowIndex];
1648 this.
Output.AppendLine(
"<tr>");
1650 for (i = 0; i < NrColumns; i++)
1658 while (j < NrColumns && Row[j++] is
null)
1661 this.
Output.Append(
"<th style=\"text-align:");
1662 this.
Output.Append((CellAlignments[i] ?? Element.ColumnAlignments[i]).ToString().ToLower());
1666 this.
Output.Append(
"\" colspan=\"");
1667 this.
Output.Append(k.ToString());
1670 this.
Output.Append(
"\">");
1671 await E.Render(
this);
1672 this.
Output.AppendLine(
"</th>");
1675 this.
Output.AppendLine(
"</tr>");
1677 this.
Output.AppendLine(
"</thead>");
1679 this.
Output.AppendLine(
"<tbody>");
1681 NrRows = Element.Rows.Length;
1682 for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
1684 Row = Element.Rows[RowIndex];
1685 CellAlignments = Element.RowCellAlignments[RowIndex];
1687 this.
Output.AppendLine(
"<tr>");
1689 for (i = 0; i < NrColumns; i++)
1697 while (j < NrColumns && Row[j++] is
null)
1700 this.
Output.Append(
"<td style=\"text-align:");
1701 this.
Output.Append((CellAlignments[i] ?? Element.ColumnAlignments[i]).ToString().ToLower());
1705 this.
Output.Append(
"\" colspan=\"");
1706 this.
Output.Append(k.ToString());
1709 this.
Output.Append(
"\">");
1710 await E.Render(
this);
1711 this.
Output.AppendLine(
"</td>");
1714 this.
Output.AppendLine(
"</tr>");
1716 this.
Output.AppendLine(
"</tbody>");
1718 this.
Output.AppendLine(
"</table>");
1727 this.
Output.Append(
"<li class=\"taskListItem\"><input disabled=\"disabled");
1731 this.
Output.Append(
"\" id=\"item");
1733 this.
Output.Append(
"\" data-position=\"");
1737 this.
Output.Append(
"\" type=\"checkbox\"");
1740 this.
Output.Append(
" checked=\"checked\"");
1742 this.
Output.Append(
"/><span></span><label class=\"taskListItemLabel\"");
1746 this.
Output.Append(
" for=\"item");
1758 bool EndLabel =
true;
1761 while (!(Loop is
null))
1763 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
1784 this.
Output.Append(
"</label>");
1796 this.
Output.Append(
"</label>");
1798 this.
Output.AppendLine(
"</li>");
1803 this.
Output.AppendLine(
"</label></li>");
1813 this.
Output.AppendLine(
"<ul class=\"taskList\">");
1815 this.
Output.AppendLine(
"</ul>");
1824 this.
Output.Append(
"<li");
1828 if (!(Detail is
null))
1833 this.
Output.Append(
" class=\"active\"");
1843 this.
Output.Append(
" class=\"active\"");
1850 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.
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.
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.
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
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 .
async Task Render(string Url, string Title, ChunkedList< MarkdownElement > ChildNodes, MarkdownDocument Document)
Generates HTML for a link.
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 .
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 .
virtual async Task RenderDocument(MarkdownDocument Document, bool Inclusion)
Renders a document.
Task RenderChildren(MarkdownElementChildren Element)
Renders the children of Element .
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.
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.
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.