Respect the spoiler flag on comments shown from user profiles - #178
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.htmlrenderedcomment.infounconditionally. The comment records already carry aspoilerflag (populated by the model), so this wraps spoiler comments in the same[Click to reveal]/revealSpoiler()pattern already used ontemplates/crackme/read.html, reusing the identical.spoiler-hiddenstyling. Non-spoiler comments render unchanged.Tests
Added two route tests in
tests/test_routes.py:Full
tests/test_routes.pysuite passes.🤖 Generated with Claude Code