Closed floatingpurr closed 1 year ago
In an effort to see if this was a core API problem, I attempted to replicate your call making an API call using postman. When sending a POST request to the /messages API with the following payload
{
"roomId" : "{{_room}}",
"markdown" : "```javascript\n// Foo\nconst numero1 = 5;\nconst numero2 = 3;\n```\n\nhello!",
"text": "This text would be displayed by Webex Teams clients that do not support markdown."
}
I found that the output of the WAS displayed in markdown, but WITHOUT syntax highlighting (which one gets when posting the same markdown directly into a webex client).
For this issue, I would recommend reporting it directly to Webex Developer Support. This may be a bug in the core API gateway and isn't something that can be fixed in the framework. (It also may just need some special "tweaking" in the API call and/or the markdown string. The developer support team can help you if that is the case!)
Having said that, it appears that you are getting NO markdown processing (ie: the markdown commands are being rendered as plain text). I am NOT able to duplicate this behaviour with the framework. With this code:
let msg = '```javascript\n// Foo\nconst numero1 = 5;\nconst numero2 = 3;\n```\n\nhello!';
bot.say('markdown', msg);
I get the exact same output as in the image above.
Can you confirm that you are seeing SOME markdown (but just not the syntax highlighting) when making a similar call with the framework?
Hi @jpjpjp, thank you very much for your investigation. I do confirm that the behavior that I'm experiencing is some markdown without syntax highlighting in code blocks. Excuse me if my initial message wasn't clear enough. I'll report this issue to the the Webex Developer Support. Thank you for the advice. I close it for now.
Hello. I'm returning
myString
to a chat withsuch a string contains a code block that Webex clients render but without code highlighting. If I try to use
text
for debug purposes:I get the following output:
It looks fine. Moreover, if I paste it into a webex chat, the code highlighting works fine. How can I obtain the same effect within a bot message?