Cleanup
This commit is contained in:
@@ -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 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user