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

Plaintext URLs containing question mark aren't converted correctly #897

Closed
SenaraW opened this issue Mar 3, 2023 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@SenaraW
Copy link

SenaraW commented Mar 3, 2023

Some of our customers get quite a lot of plaintext emails with links containing a ? like this: https://xxxxx.sophos.com?xxxxxxxxxxxx
Unfortunately the link doesn't get properly recognized, as everything after the ? won't be within the <a href>.
The resulting converted HTML looks like this:

<html>
<head>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type></head>
  <body>This is a test for html links 
  <a href="https://xxxxx.sophos.com">https://xxxxx.sophos.com</a>?xxxxxxxxxxxx<br/>
  </body>
</html>

instead of this:

<html>
<head>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type></head>
  <body>This is a test for html links 
  <a href="https://xxxxx.sophos.com?xxxxxxxxxxxx">https://xxxxx.sophos.com?xxxxxxxxxxxx</a><br/>
  </body>
</html>

I've attached a Testprogram with which you can reproduce this behavior. It converts a plaintext eml using HTMLPreviewVisitor.

Tested in .NET 4.8 with Mimekit 3.3.0 and 3.5.0

@jstedfast
Copy link
Owner

It wasn't handled because I don't think that syntax is valid.

That said, I tested GMail and the Visual Studio's URL-detection (in comments) seemed to handle it, so I added support for it.

@jstedfast jstedfast added the enhancement New feature or request label Mar 4, 2023
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