mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-31 01:10:22 -06:00
FF-1144 - added \r\n replacement to discord flow element
This commit is contained in:
@@ -78,6 +78,10 @@ public class Discord: Node
|
||||
string title = args.ReplaceVariables(this.Title)?.EmptyAsNull() ??
|
||||
this.MessageType?.EmptyAsNull() ?? "Information";
|
||||
|
||||
// replace new lines
|
||||
message = message.Replace("\\r\\n", "\r\n");
|
||||
message = message.Replace("\\n", "\n");
|
||||
|
||||
object webhook;
|
||||
if (this.MessageType == "Basic")
|
||||
{
|
||||
|
||||
@@ -18,8 +18,9 @@ public class DiscordTests
|
||||
};
|
||||
|
||||
var node = new Discord();
|
||||
node.Message = "a message";
|
||||
Assert.AreEqual(1, node.Execute(args));
|
||||
node.Message = "a message\nwith\nsome\nnewlines";
|
||||
var result = node.Execute(args);
|
||||
Assert.AreEqual(1, result);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
Reference in New Issue
Block a user