uccser / cs-field-guide

A free online interactive resource/textbook for high school students learning about computer science.

Home Page:https://www.csfieldguide.org.nz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

mckzm opened this issue · comments

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