Cange richtext tags to be overridable by content (#4141)

This commit is contained in:
Julian Giebel
2023-06-17 19:20:43 +02:00
committed by GitHub
parent a9eafd4025
commit f5b8c8813f
2 changed files with 2 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ public sealed class MarkupTagManager
continue;
var instance = (IMarkupTag)_sandboxHelper.CreateInstance(type);
_markupTagTypes.Add(instance.Name.ToLower(), instance);
_markupTagTypes[instance.Name.ToLower()] = instance;
}
foreach (var (_, tag) in _markupTagTypes)

View File

@@ -72,8 +72,7 @@ public sealed partial class FormattedMessage
private static readonly Parser<char, List<MarkupNode>> Text =
EscapeSequence.Or(Token(c => c != '[' && c != '\\'))
.AtLeastOnceString()
.Select(s => new MarkupNode(s))
.Select(tag => new List<MarkupNode>{tag});
.Select(s => new List<MarkupNode>{new(s)});
//Parses a string of letters or digits beginning with a letter
private static readonly Parser<char, string> Identifier =