Skip to content

Fix glossary references displaying as ASCII codes instead of formatted text#639

Draft
Copilot wants to merge 4 commits intoks-refactor-glossary-generatorfrom
copilot/sub-pr-595
Draft

Fix glossary references displaying as ASCII codes instead of formatted text#639
Copilot wants to merge 4 commits intoks-refactor-glossary-generatorfrom
copilot/sub-pr-595

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Glossary references were rendering as ASCII character codes (66, 114, 97...) instead of readable text due to Hugo's delimit function treating single-element string arrays as character sequences.

Changes

Hugo Template (layouts/glossary/single.html)

  • Added type detection to handle both string and array reference formats
  • String references: rendered directly via markdownify
  • Array references: iterate and display each element
  • Provides backward compatibility while supporting new reference format from updated glossary generator

Python Script (content/glossary/_create_glossaries.py)

  • Fixed regex pattern for citation key extraction: r'\\?\[@([^\]\\]+)\\?\]'
  • Now correctly parses \[@BarnesEtAl2018\] format from Google Sheets without capturing trailing backslashes
  • Removed fuzzy author-year matching (unnecessary - Google Sheet uses proper citation keys)

Context

Current glossary files contain arrays like ["Barnes et al. (2018); Tvina et al. (2019)"]. The old template's delimit call converted these to character codes. The updated template immediately fixes rendering for existing files. When the glossary is regenerated, the Python script will properly extract citation keys from the Google Sheet and replace them with full APA references from apa_lookup.json.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 11, 2026 16:51
Co-authored-by: LukasWallrich <60155545+LukasWallrich@users.noreply.github.com>
Co-authored-by: LukasWallrich <60155545+LukasWallrich@users.noreply.github.com>
Co-authored-by: LukasWallrich <60155545+LukasWallrich@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 11, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.google.com
    • Triggering command: /usr/bin/python3 python3 content/glossary/_create_glossaries.py (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add glossary generator with APA lookup Fix glossary references displaying as ASCII codes instead of formatted text Feb 11, 2026
Copilot AI requested a review from LukasWallrich February 11, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants