pdf: remove StickyHeaderTable tags before PDF generation#22970
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new function remove_sticky_header_table in scripts/merge_by_toc.py to strip <StickyHeaderTable> tags for PDF output. The review feedback suggests making the regular expression pattern more robust to handle self-closing tags and trailing spaces, and correcting the spacing between top-level functions to comply with PEP 8.
|
|
||
|
|
||
| # remove <StickyHeaderTable> / </StickyHeaderTable> tags for PDF output | ||
| sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable>\s*$') |
There was a problem hiding this comment.
The current regular expression only matches exact <StickyHeaderTable> and </StickyHeaderTable> tags. To make it more robust and handle potential variations such as self-closing tags (e.g., <StickyHeaderTable />) or trailing spaces inside the tag (e.g., <StickyHeaderTable >), we should update the pattern to allow optional trailing slashes and spaces before the closing bracket.
| sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable>\s*$') | |
| sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable\s*/?>\s*$') |
|
@shhdgit: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiancai The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
In response to a cherrypick label: new pull request created to branch |
What is changed, added or deleted? (Required)
<StickyHeaderTable>and</StickyHeaderTable>lines before PDF generation.Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?