postiz-app icon indicating copy to clipboard operation
postiz-app copied to clipboard

Broken discord formatting

Open vrisalab opened this issue 4 months ago • 15 comments

📜 Description

After a recent update, I can't use any formatting tools for my discord post, as all especial characters are escaped. This causes problems for inserting links, as they are posted as is on discord.

This issue also adds a backslash before every "_" character in the post, breaking a lot of links, and for some reason ignores some spaces.

There is another issue but I'm not sure if it's related. When queuing a post for discord via the public API, newline characters are completely ignored when posting, even when they appear in the UI. Also, if a link is surrounded with "<>" (To prevent automatic embedding), it will dissapear in the queued post and will have to be manually added.

👟 Reproduction steps

  1. Queue a post for discord with link formatting like
  2. Once posted, confirm brackets and parentheses are escaped and written like, breaking the link and not formatting it properly.

👍 Expected behavior

Special discord characters should not be escaped to allow for proper link formatting.

👎 Actual Behavior with Screenshots

This is how links look hen posted to discord

Image

💻 Operating system

Linux

🤖 Node Version

Current Postiz version

📃 Provide any additional context for the Bug.

This started to happen last week or the week before that, I can't confirm the Postiz version where it started.

👀 Have you spent some time to check if this bug has been raised before?

  • [x] I checked and didn't find similar issue

Are you willing to submit PR?

None

vrisalab avatar Aug 05 '25 01:08 vrisalab

@vrisalab, Do you use the API or access it directly from the dashboard? It should work with html elements

nevo-david avatar Aug 05 '25 06:08 nevo-david

Just added a version of hyperlinks in tiptap editor

nevo-david avatar Aug 05 '25 07:08 nevo-david

I'm using the API, so I can't use the editor to add hyperlinks, or @ people. I also now cannot @ everyone, not with the editor or via the API, as in the editor, "everyone" is not an option, and in the API the discord command gets escaped and directly posted Image Image

Edit: I can now verify that links are now properly parsed, but if I surround them with "<>" characters to prevent embedding they get escaped and break the link. In general a lot of discord commands rely on special characters, so maybe they should only be escaped if they are 100% not used in any command.

vrisalab avatar Aug 07 '25 04:08 vrisalab

@vrisalab I've just added a feature that if you don't send HTML, it won't parse it. Since you are using the Public API, you can do everything as before :)

nevo-david avatar Aug 07 '25 05:08 nevo-david

The embeds and everything is working fine, but I can't insert the "<>" characters, which is needed for @'ing everyone and other roles

vrisalab avatar Aug 07 '25 20:08 vrisalab

Can confirm it, 2.4.3 or 2.5.2 still does not correct that very important issue, making Discord almost unusable for its most important role.

Ch0wW avatar Aug 09 '25 18:08 Ch0wW

Correction: Link formatting isn't working. When you insert a link in the editor, it tries to post it with the required formatting for links in discord, but somehow the special characters get ignored and the link just doesn't work

Image

I really preferred it when the text box showed what was going to be sent as the post content, and the preview showed what it would look like. It's just so muddy now and you never know what is going to work and what is going to get escaped.

vrisalab avatar Aug 18 '25 00:08 vrisalab

Honestly, one workaround, if you don't really use other services, is to revert to a build where these HTML conversions didn't happen, which is likely any version of Postiz before 2.1.0, as it actually broke way more things than intended.

Weirdly enough, I still don't understand why we still have to go use HTML formatting, when markdown is not only way more modern and common for people, but makes everything easier to handle text & formatting. And, which seems to also be natively used by the TipTap editor.

Ch0wW avatar Aug 18 '25 16:08 Ch0wW

Build v2.5.4 does not seem to fix the issue of < and > still being escaped .

Image

Ch0wW avatar Sep 05 '25 01:09 Ch0wW

Honestly, one workaround, if you don't really use other services, is to revert to a build where these HTML conversions didn't happen, which is likely any version of Postiz before 2.1.0, as it actually broke way more things than intended.

Weirdly enough, I still don't understand why we still have to go use HTML formatting, when markdown is not only way more modern and common for people, but makes everything easier to handle text & formatting. And, which seems to also be natively used by the TipTap editor.

I had to downgrade all the way to 1.64.1, right before the tiptap editor was introduced, to remove all the issues mentioned in this thread, since downgrading to 2.0.8 fixed the mentions issue but not the other formatting issues (Links with text not working, and the underscore being escaped)

vrisalab avatar Sep 10 '25 15:09 vrisalab

@vrisalab Thanks for making me aware of an even earlier release that actually works better than I thought !

Anyway, build 2.6.1 STILL does not fix this issue.

Image

Ch0wW avatar Sep 21 '25 16:09 Ch0wW

I am building a new version now, feel free to try it, I think it fixes it

nevo-david avatar Sep 21 '25 17:09 nevo-david

I am building a new version now, feel free to try it, I think it fixes it

Looks like the underlined text still is overridden in the editor as bold text, and urls just disappear when under <>

Text used :

*Italic text*
**Bold text**
***Bolditalic Text***
~~striked text~~
__Underlined Text__


# URLs   
- https://google.fr
- <https://google.fr>
- [This is another test link](<https://google.fr>)

Result :

Image

Ch0wW avatar Sep 21 '25 17:09 Ch0wW

I think it's working now. Can you take the latest version and try again?

Image

nevo-david avatar Sep 22 '25 06:09 nevo-david

Looks like the most important issues are fixed.

*Italic text*
Bold text
***Bolditalic Text***
~~striked text~~
__Underlined Text__
__**Underlined Bold**__
___**Underlined Bold Italics**___

|| Spoiler Block ||

> Be me
> a quoted text

# URLs
- https://google.fr
- <https://google.fr>
- [This is a masked link](<https://google.fr>)

# Header 1
## Header 2
### Header 3
-# SubHeader

- Unordered Link #1
  - Unordered link #1
- Unordered Link #2

1. Ordered List 1
2. Ordered List 2
3. Ordered List 3
  1. SubList 1

`One Line block`


(POST-EDIT: for this one block, remove the '\' symbols)
\`\`\`golang
func test() error {
return nil;
}
\`\`\`

Testing pinging a group : <@&172102286628093953>
Testing pinging someone: <@133546841772916736>

Image Image

There are still minor issues linked to Heytap's editor such as the underordered sublists cannot be done (the - symbol is removed), but small workarounds can be done, by copy/pasting your text directly into the editor.

Ch0wW avatar Sep 22 '25 12:09 Ch0wW