updated to add advanced extensions to markdown

This commit is contained in:
2024-03-26 13:42:10 -06:00
parent 9ffd60ac84
commit a9269c8d2b
13 changed files with 42 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
@using Markdig
@using Management.Web.Shared.Components
@inject CoursePlanner planner
@@ -59,7 +59,13 @@
StateHasChanged();
}
private MarkupString preview { get => (MarkupString)Markdown.ToHtml(assignmentContext?.Assignment?.Description ?? ""); }
private MarkupString preview { get
{
var pipeline = new MarkdownPipelineBuilder()
.UsePipeTables().Build();
return (MarkupString)Markdown.ToHtml(assignmentContext?.Assignment?.Description ?? "", pipeline);
}
}
private string HelpText()
{
var groupNames = string.Join("\n- " , planner.LocalCourse?.Settings.AssignmentGroups.Select(g => g.Name) ?? []);

View File

@@ -26,7 +26,7 @@
}
Console.WriteLine(Navigation.BaseUri + "SignalRHub");
@* Console.WriteLine(Navigation.BaseUri + "SignalRHub"); *@
hubConnection = new HubConnectionBuilder()
.WithUrl(Navigation.BaseUri + "SignalRHub")
.WithAutomaticReconnect()

View File

@@ -1,4 +1,3 @@
@using Markdig
@using Management.Web.Shared.Components
@inject CoursePlanner planner

View File

@@ -79,4 +79,3 @@
<br>
@* <MonacoEditorDemo /> *@

View File

@@ -1,4 +1,3 @@
@using Markdig
@code {
[Parameter, EditorRequired]
@@ -40,7 +39,7 @@ else
{
@foreach(var answer in Question.Answers)
{
string answerPreview = answer.HtmlText.StartsWith("<p>")
string answerPreview = answer.HtmlText.StartsWith("<p>")
? answer.HtmlText.Replace("<p>", "<p class='m-0'>")
: answer.HtmlText;
@@ -48,16 +47,16 @@ else
@if(answer.Correct)
{
<svg
style="width: 1em;"
style="width: 1em;"
class="me-1 my-auto"
viewBox="0 0 24 24"
fill="none"
viewBox="0 0 24 24"
fill="none"
>
<path
d="M4 12.6111L8.92308 17.5L20 6.5"
stroke="var(--bs-success)"
stroke-width="2"
stroke-linecap="round"
<path
d="M4 12.6111L8.92308 17.5L20 6.5"
stroke="var(--bs-success)"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
@@ -66,7 +65,7 @@ else
{
<div
class="me-1 my-auto"
style="width: 1em;"
style="width: 1em;"
>
@if(Question.QuestionType == QuestionType.MULTIPLE_ANSWERS)
{
@@ -78,5 +77,5 @@ else
@((MarkupString)answerPreview)
</div>
</div>
}
}
}
}