mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
added template editor
This commit is contained in:
18
Management/Models/Local/AssignmentTemplate.cs
Normal file
18
Management/Models/Local/AssignmentTemplate.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace LocalModels;
|
||||
|
||||
public record AssignmentTemplate
|
||||
{
|
||||
public string Id { get; set; } = String.Empty;
|
||||
public string Name { get; set; } = String.Empty;
|
||||
public string Markdown { get; set; } = String.Empty;
|
||||
|
||||
public static IEnumerable<string> GetVariables(string markdown)
|
||||
{
|
||||
string pattern = "{{(.*?)}}";
|
||||
MatchCollection matches = Regex.Matches(markdown, pattern);
|
||||
|
||||
return matches.Select(match => match.Groups[1].Value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user