diff --git a/src/Extensions/DiffPaneModelExtensions.cs b/src/Extensions/DiffPaneModelExtensions.cs
index ec7b8ee..1c3a098 100644
--- a/src/Extensions/DiffPaneModelExtensions.cs
+++ b/src/Extensions/DiffPaneModelExtensions.cs
@@ -12,17 +12,17 @@ public static class DiffPaneModelExtensions
{
if (line.Type is ChangeType.Deleted)
{
- builder.Append("- ");
+ builder.Append("-- ");
}
if (line.Type is ChangeType.Inserted)
{
- builder.Append("+ ");
+ builder.Append("++ ");
}
if (line.Type is not ChangeType.Imaginary)
{
- builder.AppendLine(line.Text);
+ builder.AppendLine(line.Text.SanitizeForDiffBlock());
}
}
diff --git a/src/Extensions/StringExtensions.cs b/src/Extensions/StringExtensions.cs
index 3de05d3..b8848c0 100644
--- a/src/Extensions/StringExtensions.cs
+++ b/src/Extensions/StringExtensions.cs
@@ -16,6 +16,18 @@ public static class StringExtensions
return s.Replace("```", "```");
}
+ ///
+ /// Sanitizes a string for use in when "language" is "diff" by
+ /// prepending a zero-width space before syntax highlighting characters (+ and -).
+ ///
+ /// This does not call , you have to do so yourself if needed.
+ /// The string to sanitize.
+ /// The sanitized string that can be safely used in with "diff" as the language.
+ public static string SanitizeForDiffBlock(this string s)
+ {
+ return $"{s}";
+ }
+
///
/// Sanitizes a string (see ) and formats the string to use Markdown Block Code
/// formatting with a specified