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

Email address detection in markdown faulty #1001

Closed
andreasabel opened this issue Feb 10, 2022 · 3 comments · Fixed by #1003
Closed

Email address detection in markdown faulty #1001

andreasabel opened this issue Feb 10, 2022 · 3 comments · Fixed by #1003

Comments

@andreasabel
Copy link
Member

See e.g. hackage.haskell.org/package/BNFC-2.9.4/candidate:
The email [email protected] (under Support) is rendered wrongly as bnfc[email protected].

@andreasabel andreasabel changed the title Email address detecting in markdown faulty Email address detection in markdown faulty Feb 10, 2022
@gbaz
Copy link
Contributor

gbaz commented Feb 10, 2022

I believe this issue is with commonmark that hackage uses for markdown.

@andreasabel
Copy link
Member Author

andreasabel commented Feb 10, 2022

Installing the latest version, with commonmark -x autolinks README.md I get the correct rendering:

... our mailing list <a href="mailto:[email protected]">[email protected]</a>.

Without the autolinks extension, I get no rendering of the mail address:

 ... our mailing list [email protected]. 

@andreasabel
Copy link
Member Author

@gbaz Could it be the ordering of syntax specifications, see comment https://github.com/haskell/hackage-server/pull/904/files#r804234727 ?

andreasabel added a commit that referenced this issue Feb 11, 2022
#1001)

- Move `gfmExtensions` before `defaultSyntaxSpec`.

- Require commonmark-extensions-0.2.2 so `footnoteSpec` is subsumed
  under `gfmExtensions`.
  (Note: this version bump does not exclude any GHC versions.)

- Generalize `renderMarkdown` and `renderMarkdownRel` to
  `renderMarkdown'`.  We use a constraint synonym to gather
  all the constraints on type `a`, using `LANGUAGE ConstraintKinds`.

- Haddockumentation for all functions.

- Explicit export list.

Hopefully this will fix #1000 and #1001, but `renderMarkdown` has no
tests, so I cannot see the effect of my change locally.
gbaz added a commit that referenced this issue Feb 11, 2022
Commonmark: gfmExtensions needs to precede the defaultSyntaxSpec (#1000,#1001)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants