Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
InlineHTML.cs
2using System.Threading.Tasks;
6
8{
13 {
14 private readonly string html;
15
22 : base(Document)
23 {
24 this.html = HTML;
25 }
26
30 public string HTML => this.html;
31
36 public override Task Render(IRenderer Output) => Output.Render(this);
37
39 public override string ToString()
40 {
41 return this.html;
42 }
43
47 public override bool InlineSpanElement => true;
48
54 public override bool Equals(object obj)
55 {
56 return obj is InlineHTML x &&
57 this.html == x.html &&
58 base.Equals(obj);
59 }
60
65 public override int GetHashCode()
66 {
67 int h1 = base.GetHashCode();
68 int h2 = this.html?.GetHashCode() ?? 0;
69
70 h1 = ((h1 << 5) + h1) ^ h2;
71
72 return h1;
73 }
74
79 public IEnumerable<Atom> Atomize()
80 {
82
83 foreach (char ch in this.html)
84 Result.Add(new InlineHtmlCharacter(this.Document, this, ch));
85
86 return Result;
87 }
88
96 {
97 return new InlineHTML(Document, Text);
98 }
99
104 public override void IncrementStatistics(MarkdownStatistics Statistics)
105 {
106 Statistics.NrInlineHtml++;
107 }
108
109 }
110}
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
Abstract base class for all markdown elements.
MarkdownDocument Document
Markdown document.
MarkdownElement Assemble(MarkdownDocument Document, string Text)
Assembles a markdown element from a sequence of atoms.
Definition: InlineHTML.cs:95
InlineHTML(MarkdownDocument Document, string HTML)
Inline HTML.
Definition: InlineHTML.cs:21
override Task Render(IRenderer Output)
Renders the element.
override int GetHashCode()
Serves as the default hash function.
Definition: InlineHTML.cs:65
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: InlineHTML.cs:54
IEnumerable< Atom > Atomize()
Return an enumeration of the editable HTML as atoms.
Definition: InlineHTML.cs:79
override bool InlineSpanElement
If the element is an inline span element.
Definition: InlineHTML.cs:47
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
Definition: InlineHTML.cs:104
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54
Interface for elements containing editable text.
Interface for Markdown renderers.
Definition: IRenderer.cs:12