a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/libmfm] Fix multiline code block rendering for API clients with disabled HTML markup (ISH-772)

+20 -4
+20 -4
Iceshrimp.Backend/Core/Helpers/LibMfm/Conversion/MfmConverter.cs
··· 308 308 } 309 309 case MfmCodeBlockNode codeBlockNode: 310 310 { 311 - var el = CreateInlineFormattingElement("pre"); 312 - var inner = CreateInlineFormattingElement("code"); 313 - inner.TextContent = codeBlockNode.Code; 314 - el.AppendNodes(inner); 311 + var el = CreateInlineFormattingElement("pre"); 312 + 313 + if (flags.SupportsHtmlFormatting.Value) 314 + { 315 + var inner = CreateInlineFormattingElement("code"); 316 + inner.TextContent = codeBlockNode.Code; 317 + el.AppendNodes(inner); 318 + } 319 + else 320 + { 321 + var split = codeBlockNode.Code.Split('\n'); 322 + for (var index = 0; index < split.Length; index++) 323 + { 324 + var line = split[index]; 325 + el.AppendNodes(CreateTextNode(line)); 326 + if (index < split.Length - 1) 327 + el.AppendNodes(CreateElement("br")); 328 + } 329 + } 330 + 315 331 return el; 316 332 } 317 333 case MfmCenterNode: