We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fe462f commit d53002eCopy full SHA for d53002e
1 file changed
src/SmartFormat.Demo/ThirdParty/RTFLib/RTFBuilder.cs
@@ -71,13 +71,13 @@ protected override void AppendInternal(string value)
71
using (new RTFFormatWrap(this))
72
{
73
value = this.CheckChar(value);
74
- if (value.IndexOf(Environment.NewLine) >= 0)
+ if (value.Contains("\n"))
75
76
- string[] lines = value.Split(new[] {Environment.NewLine}, StringSplitOptions.None);
77
- foreach (string line in lines)
+ string[] lines = value.Split(new[] {"\r\n","\n"}, StringSplitOptions.None);
+ for (int i = 0; i < lines.Length; i++)
78
79
- this._sb.Append(line);
80
- this._sb.Append("\\line ");
+ if (i > 0) this._sb.Append("\\line ");
+ this._sb.Append(lines[i]);
81
}
82
83
else
0 commit comments