Closed danieljbk closed 2 years ago
I am sending the code, turned into text and transferred to JSON, through a HTTP POST request. I don't understand why this does not result in a perfectly normal code preview.
Hi! If you open carbon url with python code snippet you will see the same result (check it). Comment is not recognized. Then if you start typing you will see correctly highlighting is appeared. It's some tricky behavior of carbon and auto highlighting. You can open the issue in the corresponding repository.
Fortunately, there is a workaround for api: you should explicitly pass the language
option:
curl -L https://carbonara-42.herokuapp.com/api/cook \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"code": "# comment\nprint('\''Hello, world!'\'')",
"language": "python"
}' \
> code.png