Skip to content

Line Spacing in Markdown and HTML input formats for Telegram messages is incorrect #78

Description

Version: 0.2.8

While the format handling of HTML and Markdown to Telegram is ok, it is a bit wonky when it comes to new lines and paragraph breaks. It seems to newline at the wrong place, and then when it is expected to newline, it doesn't. I've tried a variety of scenarios, all to no avail. The last time it was correct was version 0.2.3, before the format conversion handling was merged. I've tried to send with format=markdown&mdv=v1 and format=markdown&mdv=v2, using both -i markdown and -i html.

Using the following markdown:

### Server: host.domain

Date/Time: **05:10:10 PM, Tuesday, 1 July 2026**
Uptime: **12:30:15 up 100 days, 1:20, 2 users, load average: 0.17, 0.06, 0.02**

_Q:	What do you call a boomerang that doesn't come back?
A:	A stick._

### Logins and Active Users: Past 8 Hours
```
boomer     pts/0        192.168.1.10   Fri Jun  3 17:02:12 2026   still logged in
lola       pts/2        192.168.1.10   Wed Jun  8 11:48:27 2026   still logged in
```
Image

The first message (above) uses apprise-go 0.2.3, while the second message (below) uses apprise-go 0.2.8. Clearly the formatting support and conversion for standard Markdown -> Telegram is much improved in 0.2.8. But the line spacing in 0.2.8 no longer follows the files. It should match the line spacing in 0.2.3. I've tried adding on each blank line, adding \n on each line.. all without success.

Using the same markdown message, but converted to HTML first:

<h3>Server: host.domain</h3>

<p>Date/Time: <strong>05:10:10 PM, Tuesday, 1 July 2026</strong>
Uptime: <strong>12:30:15 up 100 days, 1:20, 2 users, load average: 0.17, 0.06, 0.02</strong></p>

<p><em>Q: What do you call a boomerang that doesn't come back?
A:  A stick.</em></p>

<h3>Logins and Active Users: Past 8 Hours</h3>

<pre>
boomer     pts/0        192.168.1.10   Fri Jun  3 17:02:12 2026   still logged in
lola       pts/2        192.168.1.10   Wed Jun  8 11:48:27 2026   still logged in
</pre>
Image

This problem also happens even if the input is HTML. Looks like <p> does not generate the proper line feeds. I've tried adding <br> as well, also without success.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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