mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-13 12:07:21 +00:00
Added an analyzer which keeps line breaks LF on every system (#1193)
This commit is contained in:
1 parent
b1c1f13993
commit
65d50de033
96 files changed
+741
-393
No files matched your search
@@ -108,7 +108,7 @@ public static class ContentExtensions
|
||||
if (sources.Length is 0 || !file.Format.TryToComment(sources, out var comment))
|
||||
return file.Content;
|
||||
|
||||
return $"{file.Content}{Environment.NewLine}{Environment.NewLine}{comment}";
|
||||
return $"{file.Content}\n\n{comment}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -775,7 +775,7 @@ public sealed class ContentText : IContent
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var attachmentWebAddresses = new HashSet<string>(StringComparer.Ordinal);
|
||||
sb.AppendLine(this.Text);
|
||||
sb.AppendLineLF(this.Text);
|
||||
|
||||
if(this.FileAttachments.Count > 0)
|
||||
{
|
||||
@@ -856,13 +856,13 @@ public sealed class ContentText : IContent
|
||||
content = extraction.Content;
|
||||
}
|
||||
|
||||
documentBlocks.AppendLine();
|
||||
documentBlocks.AppendLine("---------------------------------------");
|
||||
documentBlocks.AppendLine($"File path: {document.FilePath}");
|
||||
documentBlocks.AppendLine("File content:");
|
||||
documentBlocks.AppendLine("````");
|
||||
documentBlocks.AppendLine(content);
|
||||
documentBlocks.AppendLine("````");
|
||||
documentBlocks.AppendLineLF();
|
||||
documentBlocks.AppendLineLF("---------------------------------------");
|
||||
documentBlocks.AppendLineLF($"File path: {document.FilePath}");
|
||||
documentBlocks.AppendLineLF("File content:");
|
||||
documentBlocks.AppendLineLF("````");
|
||||
documentBlocks.AppendLineLF(content);
|
||||
documentBlocks.AppendLineLF("````");
|
||||
|
||||
foreach (var address in WebAddresses.Find(content))
|
||||
if (WebAddresses.TryCreateRequestKey(address, out var requestKey))
|
||||
@@ -871,17 +871,17 @@ public sealed class ContentText : IContent
|
||||
|
||||
if (documentBlocks.Length > 0)
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("The following files are attached to this message:");
|
||||
sb.AppendLineLF();
|
||||
sb.AppendLineLF("The following files are attached to this message:");
|
||||
sb.Append(documentBlocks);
|
||||
}
|
||||
|
||||
var numImages = normalizedAttachments.Count(x => x is { IsImage: true, Exists: true });
|
||||
if (numImages > 0)
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($"Additionally, there are {numImages} image file(s) attached to this message. ");
|
||||
sb.AppendLine("Please consider them as part of the message content and use them to answer accordingly.");
|
||||
sb.AppendLineLF();
|
||||
sb.AppendLineLF($"Additionally, there are {numImages} image file(s) attached to this message. ");
|
||||
sb.AppendLineLF("Please consider them as part of the message content and use them to answer accordingly.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ internal static class MarkdownRenderPlanner
|
||||
return cleaned;
|
||||
|
||||
if (LooksLikeRawHtml(cleaned))
|
||||
return $"{HTML_CODE_FENCE_PREFIX}{Environment.NewLine}{cleaned}{Environment.NewLine}{CODE_FENCE_MARKER_BACKTICK}";
|
||||
return $"{HTML_CODE_FENCE_PREFIX}\n{cleaned}\n{CODE_FENCE_MARKER_BACKTICK}";
|
||||
|
||||
return cleaned;
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@ public partial class MathJaxBlock
|
||||
? "formula-block"
|
||||
: $"formula-block {this.Class}";
|
||||
|
||||
private string MathText => $"$${Environment.NewLine}{this.Value}{Environment.NewLine}$$";
|
||||
private string MathText => $"$$\n{this.Value}\n$$";
|
||||
}
|
||||
Reference in new issue
Block a user