Skip to content

fix: Explicitly handle LINK_TO_PROFILE flag in markdown output#297

Closed
Copilot wants to merge 5 commits intomainfrom
copilot/fix-268
Closed

fix: Explicitly handle LINK_TO_PROFILE flag in markdown output#297
Copilot wants to merge 5 commits intomainfrom
copilot/fix-268

Conversation

Copy link
Contributor

Copilot AI commented Jul 8, 2025

Previously, non-empty string values for LINK_TO_PROFILE (e.g. "false") were treated as truthy, causing the username to always be prefixed (and effectively “linked”) even when the flag was intended to be false. This change normalizes the link_to_profile parameter by converting it to a lowercase string and checking explicitly for "true". Only if the flag equals "true" (or boolean True) will the username be prefixed with @. Otherwise, it is rendered as plain text.

  • Convert link_to_profile to str(...).lower() for comparison
  • Prefix @username only when the string equals "true"
  • Ensure both boolean and string inputs (True/"True") are handled correctly
  • Added manual verification for string "false" case

Fixes #268.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

🚧 Copilot coding agent is using an experimental model for this task. Please take the time to report feedback with the 👍 or 👎 buttons.

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copilot AI changed the title [WIP] fix: LINK_TO_PROFILE Doesn't work as expected Explicitly handle LINK_TO_PROFILE flag in markdown output Jul 8, 2025
Copilot AI requested a review from zkoppert July 8, 2025 02:22
@zkoppert zkoppert changed the title Explicitly handle LINK_TO_PROFILE flag in markdown output fix: Explicitly handle LINK_TO_PROFILE flag in markdown output Jul 8, 2025
@github-actions github-actions bot added the fix label Jul 8, 2025
@zkoppert
Copy link
Member

zkoppert commented Jul 8, 2025

@copilot can you fix the failing GitHub action related to linting

@zkoppert
Copy link
Member

zkoppert commented Jul 8, 2025

@copilot can you add a test case for this logic

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 8, 2025

@copilot can you fix the failing GitHub action related to linting

Committed black formatting changes to markdown.py to satisfy lint rules (commit 4de456c)

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 8, 2025

@copilot can you add a test case for this logic

Added a test case covering string 'false' for link_to_profile, ensuring no @ prefix in output (commit f6f5e3e).

@zkoppert
Copy link
Member

@copilot

I'm thinking this points to a problem in the env code where we are not evaluating the string into the intended bool correctly.

👀

So I think the fix should be applied at the env.py level rather than trying to get the string to a bool right before we use it.

…info

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 15, 2025

@copilot

I'm thinking this points to a problem in the env code where we are not evaluating the string into the intended bool correctly. ...

Refactored markdown to use the boolean flags directly and removed the string-to-bool hack, since env.py now yields proper booleans. Commit e0bc52f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: LINK_TO_PROFILE Doesn't work as expected

2 participants