entity
entity copied to clipboard
The special characters don't get escaped if a message has no entities
The toMarkdownV2 function has inconsistent behavior: if its input has entities, all special characters get properly escaped, but when there are no entities or even it's an empty array, nothing happens.
In other words it goes like this:
Input: **aaa** (bbb) → Output: *aaa* \\(bbb\\) (escaped properly)
Input: aaa (bbb) → Output: aaa (bbb) (nothing changed!)
I think it really should escape the special characters every time. It must output a valid Markdown and not cause errors when passing its result to a Telegraf's own Markdown parser.
Tested on a version 0.6.0.