{{newline}} variable (was: Support linebreaks by using \n, \r and \r\n) #42
Replies: 4 comments 4 replies
-
Ooowww, this new {{variable:argument}} idea is fantastic @Taitava !!!!! Could bring text transportation on Shell Commands to a new level! |
Beta Was this translation helpful? Give feedback.
-
Now I think As for the second idea about a
|
Beta Was this translation helpful? Give feedback.
-
I'll put this on hold, because the value I was going to use for Windows CMD did not work. |
Beta Was this translation helpful? Give feedback.
-
Implemented as a debug variableJust to note this here too, I created the For real world usage, you can add newline characters by pressing enter in the shell command field. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
From #24:
\n
is a must have feature at some point, but it's too bad that it doesn't work right now. Currently e.g.echo \n >> SomeNote.md
writes literally \n to a file, at least on Windows. I need to think about how to implement it, can I just replace all\n
s in the command text with a newline? Probably not, as there is this mess: Linux and Mac use\n
(and classic Mac used\r
), but Windows uses\r\n
. So maybe I should replace\n
with a linefeed character and\r
with a carriage return character (more about these characters on Stack Overflow). I feel a bit uncertain about being able to implement this correctly, so this won't be coming soon.Another thing that might work, would be a new variable:
{{br:n}}
. This would create linebreaks (br comes from HTML's<br>
tag, but I'm not certain if I'm happy with the br name or not).n
would be a number to indicate how many linebreaks you want, so that you don't have to write anything stupid like{{br}}{{br}}{{br}}
for three linebreaks, when{{br:3}}
does the same thing. The argument could be left out:{{br}}
would give you just a single linebreak. The n argument would be a long term reason for the existence of this variable: Even if\n
(etc) will be supported in the future,{{br}}
with it's repeator argument would still be useful. And{{br}}
would adapt to use a correct linebreak in each operating system.Beta Was this translation helpful? Give feedback.
All reactions