mirror of https://github.com/oliverbooth/VPLink
fix: fix support for Discord timestamps
This commit is contained in:
parent
eef18ec1d3
commit
a49b065ee2
|
@ -78,9 +78,15 @@ public static class MentionUtility
|
||||||
using Utf8ValueStringBuilder buffer = ZString.CreateUtf8StringBuilder();
|
using Utf8ValueStringBuilder buffer = ZString.CreateUtf8StringBuilder();
|
||||||
var formatSpecifier = '\0';
|
var formatSpecifier = '\0';
|
||||||
var isEscaped = false;
|
var isEscaped = false;
|
||||||
|
var breakLoop = false;
|
||||||
|
|
||||||
for (var index = 2; index < contents.Length; index++)
|
for (var index = 2; index < contents.Length; index++)
|
||||||
{
|
{
|
||||||
|
if (breakLoop)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
char current = contents[index];
|
char current = contents[index];
|
||||||
switch (current)
|
switch (current)
|
||||||
{
|
{
|
||||||
|
@ -90,6 +96,8 @@ public static class MentionUtility
|
||||||
|
|
||||||
case ':' when !isEscaped && index + 1 < contents.Length:
|
case ':' when !isEscaped && index + 1 < contents.Length:
|
||||||
formatSpecifier = contents[index + 1];
|
formatSpecifier = contents[index + 1];
|
||||||
|
if (formatSpecifier == '>') formatSpecifier = '\0'; // ignore closing tag
|
||||||
|
breakLoop = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '>' when !isEscaped:
|
case '>' when !isEscaped:
|
||||||
|
|
Loading…
Reference in New Issue