Issue with "\" in content
I've wanted to display my own logo (banner) in my project usage, yet it couldn't handle the "\"-characters properly.
Now I took the banner example from your Wiki and changed the previous logo with mine.
just removed
const chalk = require('chalk')and replacedchalk.red( ... )withheader
code
The problem is - when I execute it:
green is a normal
console.log()and normal is the one generated.
result
The banner is made with String.raw, so every "\" is replaced with "\\", that means it is written by eg. console.log(). Yet the libary does skip them anyway.
I brute forced a little bit and found out it takes 4 or in String.raw 2 (2*2) "\" to write one into the usage.
Maybe the formater refactors between strings and deletes some "\" or delets them by some replace functions?
EDIT:
Quick fix for users: use
Straing.rawmethode as explained above and append.replaceAll("\\","\\\\")at the End.
File: test.js.zip
Hope I could help, Jakabi
The code you supplied in the zip file works correctly for me in both iTerm2 and Terminal on the mac, I think the issue is with your terminal.. Please try it in a few different terminals then let me know which terminals fail on which operating systems - thanks.
Just realised send you the wrong file... I already fixed it in this one😕 I'm very sorry.
real file test.js.zip