Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
InlineHTML.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
5
7{
12 {
13 private readonly string html;
14
21 : base(Document)
22 {
23 this.html = HTML;
24 }
25
29 public string HTML => this.html;
30
35 public override Task Render(IRenderer Output) => Output.Render(this);
36
38 public override string ToString()
39 {
40 return this.html;
41 }
42
46 public override bool InlineSpanElement => true;
47
53 public override bool Equals(object obj)
54 {
55 return obj is InlineHTML x &&
56 this.html == x.html &&
57 base.Equals(obj);
58 }
59
64 public override int GetHashCode()
65 {
66 int h1 = base.GetHashCode();
67 int h2 = this.html?.GetHashCode() ?? 0;
68
69 h1 = ((h1 << 5) + h1) ^ h2;
70
71 return h1;
72 }
73
78 public IEnumerable<Atom> Atomize()
79 {
80 LinkedList<Atom> Result = new LinkedList<Atom>();
81
82 foreach (char ch in this.html)
83 Result.AddLast(new InlineHtmlCharacter(this.Document, this, ch));
84
85 return Result;
86 }
87
95 {
96 return new InlineHTML(Document, Text);
97 }
98
103 public override void IncrementStatistics(MarkdownStatistics Statistics)
104 {
105 Statistics.NrInlineHtml++;
106 }
107
108 }
109}
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:94
InlineHTML(MarkdownDocument Document, string HTML)
Inline HTML.
Definition: InlineHTML.cs:20
override Task Render(IRenderer Output)
Renders the element.
override int GetHashCode()
Serves as the default hash function.
Definition: InlineHTML.cs:64
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: InlineHTML.cs:53
IEnumerable< Atom > Atomize()
Return an enumeration of the editable HTML as atoms.
Definition: InlineHTML.cs:78
override bool InlineSpanElement
If the element is an inline span element.
Definition: InlineHTML.cs:46
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
Definition: InlineHTML.cs:103
Interface for elements containing editable text.
Interface for Markdown renderers.
Definition: IRenderer.cs:12