Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collapse comments with long code blocks #822

Open
pushcx opened this issue Feb 12, 2020 · 3 comments
Open

collapse comments with long code blocks #822

pushcx opened this issue Feb 12, 2020 · 3 comments

Comments

@pushcx
Copy link
Member

pushcx commented Feb 12, 2020

Some clod, and I'm not saying who to be polite, is prone to posting long data dumps in comments.

Let's make the comment template add a css class if a comment includes a code block and more than 10 \n characters, style that class with a max-height and overflow: none, then use the checkbox hack to toggle the full comment (because we don't serve js to logged-out visitors).

@NattyNarwhal
Copy link
Contributor

Alternative idea: why not use a <details> tag, and if the code block hits the line limit, pre-collapse it? This works without JS, and to detect based on lines, you could hack up the Markdown parser?

@pushcx
Copy link
Member Author

pushcx commented Feb 15, 2020

Sounds good to me.

@pushcx
Copy link
Member Author

pushcx commented Feb 28, 2024

If this is going to get elbow-deep into the markdown parser, it probably depends on #1234

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

No branches or pull requests

2 participants