-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[telegram] Invalid escape of underscore character when sending messages #14204
Labels
bug
An unexpected problem or unintended behavior of an add-on
Comments
MikeTheTux
added
the
bug
An unexpected problem or unintended behavior of an add-on
label
Jan 11, 2023
Can confirm this issue. |
Daniel-at-git
added a commit
to Daniel-at-git/openhab-addons
that referenced
this issue
Feb 1, 2023
…b#14204) This PR reverts commit 1d23c32 and fix openhab#14204. Signed-off-by: Daniel Schröter d.schroeter@gmx.de
Daniel-at-git
added a commit
to Daniel-at-git/openhab-addons
that referenced
this issue
Feb 1, 2023
…b#14204) This PR reverts commit 1d23c32 and fix openhab#14204. Signed-off-by: Daniel Schröter d.schroeter@gmx.de Signed-off-by: Daniel Schröter <d.schroeter@gmx.de>
psmedley
pushed a commit
to psmedley/openhab-addons
that referenced
this issue
Feb 23, 2023
…b#14204) (openhab#14314) This PR reverts commit 1d23c32 and fix openhab#14204. Signed-off-by: Daniel Schröter <d.schroeter@gmx.de>
nemerdaud
pushed a commit
to nemerdaud/openhab-addons
that referenced
this issue
Feb 28, 2023
…b#14204) (openhab#14314) This PR reverts commit 1d23c32 and fix openhab#14204. Signed-off-by: Daniel Schröter <d.schroeter@gmx.de>
FordPrfkt
pushed a commit
to FordPrfkt/openhab-addons
that referenced
this issue
Apr 20, 2023
…b#14204) (openhab#14314) This PR reverts commit 1d23c32 and fix openhab#14204. Signed-off-by: Daniel Schröter <d.schroeter@gmx.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that #13758 was resolved incomplete.
When
parseMode
of Telegram Bot Thing is configured toNone
, underscore characters are now sent as\_
instead of_
.Expected Behavior
When
parseMode
is configured toNone
,sendTelegram("_")
transmits"_"
via TelegramCurrent Behavior
When
parseMode
is configured toNone
,sendTelegram("_")
transmits"\_"
via TelegramPossible Solution
The obvious fix would be to skip the changes from #13758 in case
parseMode
is configured toNone
.But there is more fishy with #13758: Replacing
_
by\_
will break any markdown formatting when using italic. There is already a comment on this in the PR #13758 (comment).I guess #13758 needs to be fully reverted.
Instead the user documentation must be extended, stating that unwanted markdown characters need to be escaped by the user, when using
parseMode
Markdown
.E.g.
result.replace("_", "\\_").replace("*", "\\*").replace("[", "\\[").replace("
", "\")
Similar approach will be required when using
HTML
parseMode
.Steps to Reproduce (for Bugs)
parseMode
of Telegram Bot thing is configured toNone
Context
Your Environment
The text was updated successfully, but these errors were encountered: