Skip to content

The special characters don't get escaped if a message has no entities #13

@Juribiyan

Description

@Juribiyan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions