cyberboysumanjay / Carbon-API

Unofficial API for generating beautiful images of your source code using Carbon.
https://carbonnowsh.herokuapp.com/
GNU Lesser General Public License v3.0
190 stars 45 forks source link

Cant use new line in the first method #9

Open crackedpotato007 opened 3 years ago

crackedpotato007 commented 3 years ago

The code can be only one line in the first method

ariscript commented 3 years ago

I can't use newlines in any method GET or POST.

Any request with newlines in the code field just has them be gone, resulting in a LONG one-line string of text.

cyberboysumanjay commented 3 years ago

Ideally it should follow the same syntax as url encoding does. So suppose this is a request for code to be in one line https://carbonnowsh.herokuapp.com/?code=This%20is%20one%20line

Replacing %20 with %250A should shift it to a new line https://carbonnowsh.herokuapp.com/?code=This%20is%250Anext%20line

Will try to encode and push changes to the API to handle such scenarios

ariscript commented 3 years ago

Seems to work with it URI encoded. Didn't think that I had to do that in the case of sending a POST request because JSON can handle any string thrown at it.

Asliddin750750 commented 2 years ago

"This is%0Anext line" in post request %0A - is \n