-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Components: Prevent generated readmes duplicating h1 elements when published #66180
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
{ h1: typeDocs.displayName }, | ||
'<!-- This file is generated automatically and cannot be edited directly. Make edits via TypeScript types and TSDocs. -->', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also appended a note on how to make edits. Especially because there is an "edit link" at the bottom of the Block Editor Handbook pages that points to the readme file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I initially thought about git-ignoring the READMEs, but then realised they're too important in helping navigating the repo — so we should probably keep them around even if they're auto-generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
…blished (WordPress#66180) Co-authored-by: mirka <[email protected]> Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
What?
Fixes an issue with autogenerated component readmes (#66035) that causes a duplicate
h1
element when published to the Block Editor Handbook.Why?
Autogenerated readmes have a duplicated
h1
element when published, even though manual readmes also have ah1
element at the top of the markdown and don't get duplicated.Duplicated
Non-duplicated
Turns out, the script that de-duplicates the
h1
only works when the very first thing in the markdown file is theh1
.How?
Move the comment down so the
h1
can be the first thing in the markdown.Testing Instructions
We'll see when this is published 🤞