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

[Post Comments] Unnecessary code comments are output to the front end #37989

Closed
kjellr opened this issue Jan 14, 2022 · 2 comments
Closed

[Post Comments] Unnecessary code comments are output to the front end #37989

kjellr opened this issue Jan 14, 2022 · 2 comments
Labels
[Block] Comments (legacy) The legacy mode of the Comments block (formerly known as Post Comments) [Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.

Comments

@kjellr
Copy link
Contributor

kjellr commented Jan 14, 2022

Description

The Post Comments block outputs unnecessary HTML comments on the front end. Most of this seems pretty harmless, but the <!-- You can start editing here. --> snippet seems like a really confusing message to show here. 🙂

Step-by-step reproduction instructions

  1. Add a "Post Comments" block.
  2. Publish or Preview the post on the front end.
  3. Open the inspector, and find the outputted code.

Screenshots, screen recording, code snippet

Screen Shot 2022-01-14 at 3 11 25 PM

Environment info

Gutenberg 12.4-RC-1 (via trunk)
WordPress 5.8.3

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@kjellr kjellr added [Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality [Block] Comments (legacy) The legacy mode of the Comments block (formerly known as Post Comments) labels Jan 14, 2022
@kjellr kjellr changed the title [Post Comments] Unnecessary comments markup is output to the front end [Post Comments] Unnecessary code comments are output to the front end Jan 14, 2022
@talldan
Copy link
Contributor

talldan commented Jan 17, 2022

@kjellr Looks like those comments are coming from here:
https://github.com/WordPress/wordpress-develop/blob/a0b1f27de6c928fde51bbc7078b32ca9c9d6ed8d/src/wp-includes/theme-compat/comments.php#L30-L75

This may have to be a core trac ticket.

It seems like usually themes will provide their own comments template, and checking TT1, that also includes different HTML comments that are output to the frontend, so the block doesn't seem to be doing anything wrong, it's just the first time these comments have surfaced for a while 😄

@kjellr
Copy link
Contributor Author

kjellr commented Jan 18, 2022

Thanks for looking into it, @talldan! I've opened a new core ticket here: https://core.trac.wordpress.org/ticket/54851

... and will close this one. 👍

@kjellr kjellr closed this as completed Jan 18, 2022
@kjellr kjellr added the [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. label Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comments (legacy) The legacy mode of the Comments block (formerly known as Post Comments) [Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
None yet
Development

No branches or pull requests

2 participants