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

[Bug]: Link to "Entropy (information theory)" Wikipedia entry in coding-introduction/further-reading doesn't render properly #2565

Closed
1 task done
mckzm opened this issue Mar 23, 2024 · 0 comments · Fixed by #2566
Labels

Comments

@mckzm
Copy link
Contributor

mckzm commented Mar 23, 2024

Description of the bug

This affects both the production[0] and development[1] sites.

expected behaviour:

  • the link should render as Entropy and information theory
  • its URL should be https://en.wikipedia.org/wiki/Entropy_(information_theory)

actual behaviour:

  • the link renders as Entropy and information theory) // unexpected trailing parenthesis
  • the URL is incorrect: https://en.wikipedia.org/wiki/Entropy_(information_theory // the URL's closing parenthesis is missing

I am attaching a screenshot taken of the dev site earlier today.

[0] https://www.csfieldguide.org.nz/en/chapters/coding-introduction/further-reading/
[1] https://cs-field-guide-dev.csse.canterbury.ac.nz/en/chapters/coding-introduction/further-reading/

Steps To Reproduce

  1. go to https://www.csfieldguide.org.nz/en/chapters/coding-introduction/further-reading/#useful-links (Prod) or https://cs-field-guide-dev.csse.canterbury.ac.nz/en/chapters/coding-introduction/further-reading/#useful-links (Dev).
  2. Observe the second resource listed - Entropy and information theory) - is incorrectly rendered, and points to an incorrect entry, per the description above.

What device/software are you seeing this problem on?

macos 14.4 on Safari 17.4 and Chrome 123.0.6312.59
iOS 17.4/Safari

screenshot (Dev site):

trailing_paren-230324

Additional Information

Tentative analysis:

Newer Markdown implementations (e.g. GitHub's as of this writing) properly render an inline link[0] whose link destination[1] includes parenthesis. Older ones fail, and, as a result, what should be rendered in HTML as:

href="https://en.wikipedia.org/wiki/Entropy_(information_theory)"

is instead rendered as:

href="https://en.wikipedia.org/wiki/Entropy_(information_theory"

(closing parenthesis elided/wrong URL)

Wrapping the link destination within angle brackets solves that issue and should be forward compatible. Percent-encoding the inner parens (w/ %28 and %29, respectively) works as well.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mckzm mckzm added the bug label Mar 23, 2024
mckzm added a commit to mckzm/cs-field-guide that referenced this issue Mar 23, 2024
Make "Entropy and information theory" inline link compatible with older markdown implementations.

fixes uccser#2565

Newer Markdown implementations (e.g. GitHub's as of this writing) properly render an inline link[0] whose link destination[1] includes parenthesis. Older ones fail, and, as a result, what should be rendered as:

href="https://en.wikipedia.org/wiki/Entropy_(information_theory)"

is instead rendered as:

href="https://en.wikipedia.org/wiki/Entropy_(information_theory"

(closing parenthesis elided/wrong URL)

Wrapping the link destination within angle brackets solves that issue in a way that should be forward-compatible.

[0] https://spec.commonmark.org/0.31.2/#inline-link
[1] https://spec.commonmark.org/0.31.2/#link-destination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant