nasa-gcn / gcn.nasa.gov

General Coordinates Network (GCN) web site
https://gcn.nasa.gov
Other
172 stars 41 forks source link

Circulars: Convert emails to hyperlinks #2456

Open tylerbarna opened 1 month ago

tylerbarna commented 1 month ago

Description

We currently have functionality that automatically inserts hyperlinks for URLs, DOIs, TNSs, and GCN Circulars when they're referenced in Circulars. It may be beneficial to automatically hyperlink email addresses, both in the body of Circulars and in the submitter information.

The submitter email will be a more straightforward regular expression, as it can simply be a regular expression that matches any string enclosed by <>, but the regular expression to link to emails in a Circular may be less straightforward.

Acceptance criteria

lpsinger commented 1 month ago

It already works for Markdown-formatted Circulars because this is done by the autolink literals plugin.

lpsinger commented 1 month ago

Here's where the code lives: https://github.com/nasa-gcn/gcn.nasa.gov/blob/main/app/routes/circulars.%24circularId.(%24version)/rehypeAutolinkLiteral.ts

tylerbarna commented 1 month ago

It already works for Markdown-formatted Circulars because this is done by the autolink literals plugin.

does this include the submitter email in the header?

lpsinger commented 1 month ago

It already works for Markdown-formatted Circulars because this is done by the autolink literals plugin.

does this include the submitter email in the header?

No, but you could easily process that using remark/rehype.

tylerbarna commented 1 month ago

@lpsinger that's what I was thinking, should this issue be migrated to remark-rehype-astro?

lpsinger commented 1 month ago

No. As I said, this code is in https://github.com/nasa-gcn/gcn.nasa.gov/blob/main/app/routes/circulars.%24circularId.(%24version)/rehypeAutolinkLiteral.ts.