Many appended reusable tables are rendered incorrectly #22161
Closed
Description
Code of Conduct
- 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)