feature: subject presenter supports inline codeblock

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-04-25 13:24:13 +08:00
parent 9efbc7dd7a
commit 8c4362a98d
No known key found for this signature in database
7 changed files with 289 additions and 119 deletions

View file

@ -0,0 +1,38 @@
namespace SourceGit.Models
{
public enum InlineElementType
{
None = 0,
Keyword,
Link,
CommitSHA,
Code,
}
public class InlineElement
{
public InlineElementType Type { get; set; } = InlineElementType.None;
public int Start { get; set; } = 0;
public int Length { get; set; } = 0;
public string Link { get; set; } = "";
public InlineElement(InlineElementType type, int start, int length, string link)
{
Type = type;
Start = start;
Length = length;
Link = link;
}
public bool Intersect(int start, int length)
{
if (start == Start)
return true;
if (start < Start)
return start + length > Start;
return start < Start + Length;
}
}
}