Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ParseMarkdown.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
3using Waher.Script;
7
9{
14 {
23 : base(Markdown, Start, Length, Expression)
24 {
25 }
26
30 public override string FunctionName => nameof(ParseMarkdown);
31
36 public override bool IsAsynchronous => true;
37
45 {
46 return this.EvaluateScalarAsync(Argument, Variables).Result;
47 }
48
55 public override async Task<IElement> EvaluateScalarAsync(string Argument, Variables Variables)
56 {
57 MarkdownSettings Settings = new MarkdownSettings()
58 {
60 ParseMetaData = MarkdownDocument.HeaderEndPosition(Argument).HasValue
61 };
62
64
65 return new ObjectValue(Doc);
66 }
67
68 }
69}
ParseMarkdown(ScriptNode Markdown, int Start, int Length, Expression Expression)
ParseMarkdown(Markdown)
override async Task< IElement > EvaluateScalarAsync(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
override string FunctionName
Name of the function
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
Contains a markdown document. This markdown document class supports original markdown,...
static ? int HeaderEndPosition(string Markdown)
Gets the end position of the header, if one is found, null otherwise.
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.
Class managing a script expression.
Definition: Expression.cs:39
Base class for funcions of one scalar string variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20