Many appended reusable tables are rendered incorrectly
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
Several articles that include reusable tables have incorrectly rendered tables. Examples:
- https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types#issuesevent
- https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types#event-object-properties
- https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#webhook-payload-object-common-properties
#22146 and #22102 also include examples of this issue. This appears to be a largely systemic issue that affects tables that are being appended to each other using reusables.
What part(s) of the article would you like to see updated?
The template tags need to be changed from {% ... %} to {%- ... -%} so that the tables are appended correctly and rendered correctly.
The following script appears to fix many of these issues, but may also have a lot of collateral damage (did not check if it has negative effects, but noticed it affects a lot of non-table reusables):
perl -i -p0e 's/%\}\n\{% data reusables/%\}\n\{%- data reusables/g' $(git grep -l -P "{% data reusables" content)
perl -i -p0e 's/(?<=\{%- data reusables.{1,100})%\}/-%\}/g' $(git grep -l -P "{% data reusables" content)
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
@achow101 Thanks so much for opening an issue! We appreciate all the information you provided ✨
We've come up with an internal fix for this. Markdown tables should be rendering correctly now. I'm going to close this, but please come back and open a new issue if you come across any tables that are still broken 💖
Thank you for your interest in improving the docs!