This commit is contained in:
2026-07-18 15:21:20 -04:00
parent 6062d5b60c
commit 74f065e0f5
51 changed files with 634 additions and 285 deletions
@@ -1,4 +1,3 @@
@using Model
@using System.Text.RegularExpressions
@using Microsoft.AspNetCore.Components.Rendering
@namespace Chrono.Components
@@ -35,8 +34,15 @@
[Parameter] public DocData? Doc { get; set; }
[Parameter] public EventCallback OnClose { get; set; }
private void HandleClose() => _ = OnClose.InvokeAsync();
private void HandleBackdropClick() => _ = OnClose.InvokeAsync();
private void HandleClose()
{
_ = OnClose.InvokeAsync();
}
private void HandleBackdropClick()
{
_ = OnClose.InvokeAsync();
}
private RenderFragment RenderDescription(string content)
{
@@ -61,12 +67,14 @@
builder.OpenElement(seq++, "ul");
inList = true;
}
builder.OpenElement(seq++, "li");
RenderInlines(builder, ref seq, trimmedLine[2..]);
builder.CloseElement();
continue;
}
else if (inList)
if (inList)
{
builder.CloseElement();
inList = false;
@@ -94,10 +102,21 @@
var bestIdx = int.MaxValue;
Match? bestMatch = null;
int matchType = 0; // 1: bold, 2: italic
var matchType = 0; // 1: bold, 2: italic
if (boldMatch.Success && boldMatch.Index < bestIdx) { bestIdx = boldMatch.Index; bestMatch = boldMatch; matchType = 1; }
if (italicMatch.Success && italicMatch.Index < bestIdx) { bestIdx = italicMatch.Index; bestMatch = italicMatch; matchType = 2; }
if (boldMatch.Success && boldMatch.Index < bestIdx)
{
bestIdx = boldMatch.Index;
bestMatch = boldMatch;
matchType = 1;
}
if (italicMatch.Success && italicMatch.Index < bestIdx)
{
bestIdx = italicMatch.Index;
bestMatch = italicMatch;
matchType = 2;
}
if (bestMatch != null)
{
@@ -115,4 +134,5 @@
}
}
}
}