- Use tokinzer for URL parsing

- Regex based split for letter selector
This commit is contained in:
Infi
2024-05-21 06:36:57 +02:00
parent 759aca4ce0
commit 140343e654
7 changed files with 106 additions and 85 deletions
+19
View File
@@ -70,6 +70,11 @@ public class TextChunk : Chunk
[Key(6)]
public string Content { get; set; }
private TextChunk(Chunk chunk, string content) : base(chunk.Source, chunk.Link)
{
Content = content;
}
internal TextChunk(ChunkSource source, Payload? link, string content) : base(source, link)
{
// This has been null in the past, and it broke rendering code.
@@ -102,6 +107,20 @@ public class TextChunk : Chunk
Italic = Italic,
};
}
/// <summary>
/// Creates a new TextChunk with identical styling to this one.
/// </summary>
public TextChunk NewWithStyle(Chunk chunk, string content)
{
return new TextChunk(chunk, content)
{
FallbackColour = FallbackColour,
Foreground = Foreground,
Glow = Glow,
Italic = Italic,
};
}
}
[MessagePackObject]