Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PreprocessMarkdown.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(PreprocessMarkdown);
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 = false
61 };
62
63 KeyValuePair<string, bool> P = await MarkdownDocument.Preprocess(Argument, Settings, string.Empty, false);
64
65 return new StringValue(P.Key);
66 }
67
68 }
69}
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
PreprocessMarkdown(ScriptNode Markdown, int Start, int Length, Expression Expression)
PreprocessMarkdown(Markdown)
override async Task< IElement > EvaluateScalarAsync(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function on a scalar argument.
override string FunctionName
Name of the function
Contains a markdown document. This markdown document class supports original markdown,...
static async Task< string > Preprocess(string Markdown, MarkdownSettings Settings, params Type[] TransparentExceptionTypes)
Preprocesses markdown text.
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