NNostr
NNostr copied to clipboard
I can't post a new line
Or rather, I cannot post '\'
Can you please provide a full example?
See the following code https://github.com/betonetojp/nokakoi/blob/4db437d80928de4feb19f00dcdbdeaab438e8db8/nokakoi/FormMain.cs#L509
I cannot post when textBoxPost.Text = "hello\nworld".
I'm sure there's a better solution, but adding
payload = payload.Replace("\\\\n", "\\n");
after this line https://github.com/Kukks/NNostr/blob/46e80c12ad90afff7b8606d155adbf3b614dbea1/NNostr.Client/NostrClient.cs#L192 allowed me to post a new line.
"\n" is not a newline character. the ASCII code for a newline (line feed) character is 10. If you want a new line, you should use the actual character for it, not the text "\n". Or use a multi-line control on your form, so you can just press the enter key to get new lines. Or, if you want to type "\n" in your textbox, but replace it with a newline character, use: Content = textBoxPost.Text.Replace("\\n", "\n");
Version 0.0.49 seems to fix it. thx.