From 4d904bc673fe72a448d357f817582dd236d86d1a Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sun, 5 Jan 2025 04:32:50 +0100 Subject: [PATCH] [backend/federation] Fix compatibility with AP servers that send
without a trailing newline character --- .../Core/Helpers/LibMfm/Conversion/MfmConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Core/Helpers/LibMfm/Conversion/MfmConverter.cs b/Iceshrimp.Backend/Core/Helpers/LibMfm/Conversion/MfmConverter.cs index ca19e875..9a2a1e0a 100644 --- a/Iceshrimp.Backend/Core/Helpers/LibMfm/Conversion/MfmConverter.cs +++ b/Iceshrimp.Backend/Core/Helpers/LibMfm/Conversion/MfmConverter.cs @@ -53,7 +53,7 @@ public class MfmConverter( if (html == null) return new HtmlMfmData("", media); // Ensure compatibility with AP servers that send both
as well as newlines - var regex = new Regex(@"\r?\n", RegexOptions.IgnoreCase); + var regex = new Regex(@"(?:\r?\n)?", RegexOptions.IgnoreCase); html = regex.Replace(html, "\n"); // Ensure compatibility with AP servers that send non-breaking space characters instead of regular spaces