Skip to content

Respect the spoiler flag on comments shown from user profiles - #178

Merged
xusheng6 merged 1 commit into
mainfrom
fix/profile-comment-spoilers
Jul 26, 2026
Merged

Respect the spoiler flag on comments shown from user profiles#178
xusheng6 merged 1 commit into
mainfrom
fix/profile-comment-spoilers

Conversation

@xusheng6

Copy link
Copy Markdown
Contributor

Problem

Fixes #148.

A comment marked as a spoiler is hidden behind a click-to-reveal on the crackme page, but the same comment shows in full on the author's profile under the Comments tab — defeating the point of the spoiler mark.

Fix

templates/user/read.html rendered comment.info unconditionally. The comment records already carry a spoiler flag (populated by the model), so this wraps spoiler comments in the same [Click to reveal] / revealSpoiler() pattern already used on templates/crackme/read.html, reusing the identical .spoiler-hidden styling. Non-spoiler comments render unchanged.

Tests

Added two route tests in tests/test_routes.py:

  • a spoiler comment is wrapped/hidden on the profile page
  • a non-spoiler comment renders in full

Full tests/test_routes.py suite passes.

🤖 Generated with Claude Code

Comments marked as spoilers were rendered hidden on the crackme page but
shown in full on the author's profile Comments tab, leaking the content the
spoiler mark is meant to conceal (#148). Wrap spoiler comments on the profile
page with the same click-to-reveal behavior used on the crackme page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xusheng6
xusheng6 merged commit 0332a8b into main Jul 26, 2026
4 checks passed
@xusheng6
xusheng6 deleted the fix/profile-comment-spoilers branch July 26, 2026 12:24
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.

Comment spoilers do not work when checking a comment from a user's profile

1 participant