Skip to content

[Bug]: Some mailto links with dash inside are not shown correctly #20557

@BaumiCoder

Description

@BaumiCoder

Attach (recommended) or Link to PDF file

mail-test.pdf

Web browser and its version

Mozilla Firefox 146.0.1 (64-Bit)

Operating system and its version

Manjaro Linux (Kernel Version: 6.17.13-1-MANJARO; Graphics Platform: Wayland; KDE Plasma Version: 6.5.4)

PDF.js version

5.4.396 [0a2680b]

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Open the provided example file
  2. Hover over (or click) the second email address

What is the expected behavior?

I see the full email address in the mailto link hint (or after the click in my email client)

What went wrong?

The email address is cut off after the dash:
Image

Link to a viewer

No response

Additional context

Source

This PDF is build from the following LaTeX code:

\documentclass{amsart}

\usepackage{hyperref}

% Macro to use same adress for \email and href example
\newcommand{\myemail}{[email protected]}

\title{email in amsart}
\author{John Doe}
% Second email address  with the problem comes from here
\email{\myemail}

\begin{document}
    \maketitle  

    % First email address inside the PDF (for comparision) this one works fine
    email link in the text body: \href{mailto:\myemail}{\myemail}

\end{document}

Other PDF Viewers

  • VSCodium and Obsidian behaves the same, but I think they are using PDF.js.
  • KDE Okular only shows a mailto link for the first email address.
  • Chromium (with the default PDF viewer, I think that is pdfium) shows mailto links for both email addresses without problems.

If you think the second mailto link in the PDF file is broken in any way, an explanation with details (and a possible reason why some other viewers have no problems with it) would be helpful. Then I would report the bug to the LaTeX class maintainers.

Without a dot between @ and dash

In case of an email address without a dot between the @-Symbol and the dash, PDF.js does not show any mailto link for the second email address. Example with [email protected] instead of [email protected]: mail-test.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions