Skip to content

Fix unintended highlighting of certain glossary terms#103

Open
httphypixelnet wants to merge 8 commits into
frcsoftware:mainfrom
httphypixelnet:fix/better-glossary
Open

Fix unintended highlighting of certain glossary terms#103
httphypixelnet wants to merge 8 commits into
frcsoftware:mainfrom
httphypixelnet:fix/better-glossary

Conversation

@httphypixelnet

Copy link
Copy Markdown

Description

This PR aims to close #98 and create a framework for content authors to add glossary terms without worrying about them colliding with unrelated words (eg: CAN vs can). It also fixes certain type issues and enforces Typescript best practices.

Closes #98

Meta

Merge checklist:

@samfreund

Copy link
Copy Markdown
Member

Prefer going by case. When CAN is meant to be referenced as the glossary item, we expect it to be capitalized. This should be sufficient for all other terms as well.

Additionally, various ts fixes should be a separate PR (they're free).

@httphypixelnet

httphypixelnet commented Jul 20, 2026

Copy link
Copy Markdown
Author

Prefer going by case

So instead of an autoDetect, we have two RegEx to match case-sensitive and case-insensitive terms?

Additionally, various ts fixes should be a separate PR (they're free).

Got it.

@samfreund

Copy link
Copy Markdown
Member

Prefer going by case

So instead of an autoDetect, we have two RegEx to match case-sensitive and case-insensitive terms?

I would say the simplest option is to check if the word in the glossary is lowercase, is so match any case. If it's mixed case/upper (proper noun), match only specifics. Having people label case-(in)sensitivity would also work, design decision tbh.

@httphypixelnet

Copy link
Copy Markdown
Author

If it's mixed case/upper (proper noun), match only specifics

All of the terms in the glossary as of now are mixed case (and I can't imagine there will be a place where something like "Magnetic Encoder" will not be the same magnetic encoder as the glossary term).

@samfreund

Copy link
Copy Markdown
Member

If it's mixed case/upper (proper noun), match only specifics

All of the terms in the glossary as of now are mixed case (and I can't imagine there will be a place where something like "Magnetic Encoder" will not be the same magnetic encoder as the glossary term).

Yeah, you'd want to convert those to lowercase. As I said though, it's up to you which approach you want to take.

@httphypixelnet

Copy link
Copy Markdown
Author

I'm gonna go with the current approach until we find a use-case that makes it worse than the other approach

@httphypixelnet

Copy link
Copy Markdown
Author

(ready for review)

@github-actions

Copy link
Copy Markdown

🌐 Preview URL: https://pr-103.frcsoftware.pages.dev

@httphypixelnet

Copy link
Copy Markdown
Author
image hmmmm, I think the boundaries are incorrect on these. fixing

@samfreund samfreund left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiring people to wrap in a glossary block is a lot of overhead. I'd prefer if we add an option to the glossary to make terms case-sensitive, rather than requiring wrapping.

@httphypixelnet

Copy link
Copy Markdown
Author

As I said though, it's up to you which approach you want to take.

💀 you told me it was up to me, and then blocked the merge because I didn't design it how you wanted?

@samfreund

Copy link
Copy Markdown
Member

As I said though, it's up to you which approach you want to take.

💀 you told me it was up to me, and then blocked the merge because I didn't design it how you wanted?

My understanding was that it would be case-sensitive regardless, and not require wrapping in a glossary block. The first approach would've used mixed case for terms that will be sensitive in the glossary, and the second approach would have a Boolean indicator of whether it should be case-sensitive. If that wasn't clear, I apologize.

@samfreund
samfreund requested a review from a team as a code owner July 22, 2026 18:09
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.

Fix glossary system to avoid unintentional highlighting

2 participants