[backend/federation] Fix compatibility with AP servers that send <br> without a trailing newline character
This commit is contained in:
parent
729e32594b
commit
4d904bc673
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ public class MfmConverter(
|
||||||
if (html == null) return new HtmlMfmData("", media);
|
if (html == null) return new HtmlMfmData("", media);
|
||||||
|
|
||||||
// Ensure compatibility with AP servers that send both <br> as well as newlines
|
// Ensure compatibility with AP servers that send both <br> as well as newlines
|
||||||
var regex = new Regex(@"<br\s?\/?>\r?\n", RegexOptions.IgnoreCase);
|
var regex = new Regex(@"<br\s?\/?>(?:\r?\n)?", RegexOptions.IgnoreCase);
|
||||||
html = regex.Replace(html, "\n");
|
html = regex.Replace(html, "\n");
|
||||||
|
|
||||||
// Ensure compatibility with AP servers that send non-breaking space characters instead of regular spaces
|
// Ensure compatibility with AP servers that send non-breaking space characters instead of regular spaces
|
||||||
|
|
Loading…
Add table
Reference in a new issue