Skip to content
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

Remove tel: links when converting signature to plain version #1724

Closed
ceskyDJ opened this issue Aug 27, 2024 · 3 comments
Closed

Remove tel: links when converting signature to plain version #1724

ceskyDJ opened this issue Aug 27, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ceskyDJ
Copy link

ceskyDJ commented Aug 27, 2024

Describe the bug

When I let the editor convert my signature (I think similar situation is for the whole message) from HTML to plain version, it doesn't remove tel: links, so it produces something like: "Phone: +420 777 123 456 tel:+420 777123456", which is ugly and I need to manually remove the tel:+420 777123456 part. It works well for e-mail (e.g. mailto:foo@example.com) links, so I hope it won't be such a problem to fix it for phone links, too.

To Reproduce (simpler way to describe point-by-point but doesn't work in New email modal, too)
Steps to reproduce the behavior:

  1. Login to some account (in public interface, not admin one)
  2. Go to Settings --> Edit identity --> Signature
  3. Set HTML mode
  4. Fill in Phone: <a href="tel:+420777123456">+420 777 123 456</a>
  5. Set plain mode
  6. See "Phone: +420 777 123 456 tel:+420 777123456" instead of just "Phone: +420 777 123 456"

Expected behavior
Remove tel: links before converting to plain text version, so "tel:+XXXXXXXXXXXX" won't be added.

Please complete the following information:

  • Browser: Version 1.68.134 Chromium: 127.0.6533.88 (Official Build) (64-bit)
  • IMAP daemon: dovecot (Mailcow)
  • PHP version: 8.2.22
  • SnappyMail Version: 2.37.2 (waiting for Watchtower to update it for testing purposes, shouldn't be fixed in the current release)
  • Mode: Docker Compose
@the-djmaze
Copy link
Owner

It could be because of spaces or other tel: vs text markup.

For example: tel:+31612345678 an text +31 (0)6 1234 5678

Also some applications convert numbers to phonenumbers automatic (like whatsapp).

So what would be the best approach to convert these types of links?
As they are way more complex then email addresses.

@ceskyDJ
Copy link
Author

ceskyDJ commented Aug 27, 2024

Minimal change should consists in ignoring spaces when comparing href attribute and <a> content, as spaces aren't allowed in tel: links (see https://datatracker.ietf.org/doc/html/rfc3966#section-3).

The best results would be done by determining when there is a phone number in <a>'s content (e.g. "+420 777 123 456" vs "Call me"). But it's hard to check, so maybe the "minimal change" would be good enough.

@the-djmaze the-djmaze added the enhancement New feature or request label Aug 27, 2024
@ceskyDJ
Copy link
Author

ceskyDJ commented Aug 27, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants