Skip to content

Handle invalid telegram html entities better #118

Open
@jmbrunskill

Description

@jmbrunskill

Describe the bug

{\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: can't parse entities: Unsupported start tag \\\"h3\\\" at byte offset 0\"}"

https://core.telegram.org/api/entities#allowed-entities

Allowed entities
For example the following HTML/Markdown aliases for message entities can be used:

[messageEntityBold](https://core.telegram.org/constructor/messageEntityBold) => <b>bold</b>, <strong>bold</strong>, **bold**
[messageEntityItalic](https://core.telegram.org/constructor/messageEntityItalic) => <i>italic</i>, <em>italic</em> *italic*
[messageEntityCode](https://core.telegram.org/constructor/messageEntityCode) => <code>code</code>, `code`
[messageEntityStrike](https://core.telegram.org/constructor/messageEntityStrike) => <s>strike</s>, <strike>strike</strike>, <del>strike</del>, ~~strike~~
[messageEntityUnderline](https://core.telegram.org/constructor/messageEntityUnderline) => <u>underline</u>
[messageEntityPre](https://core.telegram.org/constructor/messageEntityPre) => <pre language="c++">code</pre>,

To Reproduce

Steps to reproduce the behaviour:

  1. Create a notification with an h3 tag or p (looks like most things aren't supported!)
  2. Send notification - causes telegram error

Expected behaviour

Not entirely sure?? Would be good to show what the problem is better...

We probably will need different telegram and email templates eventually?
Maybe we can convert html to markdown first then send it as markdown to telegram?

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions