matteodf / html-to-slack

A module to convert HTML strings to Slack blocks
GNU General Public License v3.0
5 stars 1 forks source link

Invalid attachments when using an image in a paragraph #7

Open GAsplund opened 2 days ago

GAsplund commented 2 days ago

When an image is added within a <p> tag, it is interpreted as a rich_text_section, which does not accept images. For example, <p><img src="https://example.com/example.png" alt="Text" /></p> is translated into:

{
  "type": "rich_text_section",
  "elements": [
    {
      "type": "image",
      "image_url": "https://example.com/example.png",
      "alt_text": "Text"
    }
  ]
}

When this is sent to a webhook, it responds with invalid_attachments and HTTP 400.

matteodf commented 1 day ago

Hi @GAsplund , Thank you very much for your report. I will try to fix the problem as soon as possible!