secure emojis in parsing, fix #39

This commit is contained in:
Nicolas Constant 2021-01-11 19:50:08 -05:00
parent 778db7d3ff
commit cb64e9747a
No known key found for this signature in database
GPG key ID: 1E9F677FB01A5688
2 changed files with 34 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -314,5 +314,26 @@ namespace BirdsiteLive.Domain.Tests.Tools
Assert.IsTrue(result.content.Contains(@"<a href=""https://domain.name/tags/dada"" class=""mention hashtag"" rel=""tag"">#<span>dada</span></a>"));
#endregion
}
[TestMethod]
public void Extract_Emoji_Test()
{
#region Stubs
var message = $"😤@mynickname 😎😍🤗🤩😘";
//var message = $"tests@mynickname";
#endregion
var service = new StatusExtractor(_settings);
var result = service.ExtractTags(message);
#region Validations
Assert.AreEqual(1, result.tags.Length);
Assert.IsTrue(result.content.Contains(
@"😤 <span class=""h-card""><a href=""https://domain.name/@mynickname"" class=""u-url mention"">@<span>mynickname</span></a></span>"));
Assert.IsTrue(result.content.Contains(@"😎 😍 🤗 🤩 😘"));
#endregion
}
}
}