Skip to content

pdf: remove StickyHeaderTable tags before PDF generation#22970

Merged
ti-chi-bot[bot] merged 4 commits into
pingcap:masterfrom
qiancai:pdf-remove-sticky-header-tag
Jun 3, 2026
Merged

pdf: remove StickyHeaderTable tags before PDF generation#22970
ti-chi-bot[bot] merged 4 commits into
pingcap:masterfrom
qiancai:pdf-remove-sticky-header-tag

Conversation

@qiancai
Copy link
Copy Markdown
Collaborator

@qiancai qiancai commented May 29, 2026

What is changed, added or deleted? (Required)

  • Remove standalone <StickyHeaderTable> and </StickyHeaderTable> lines before PDF generation.
  • If either tag is surrounded by blank lines, remove the blank line after the tag together with the tag line, so the merged Markdown does not leave extra empty rows that affect PDF rendering.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 29, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread scripts/merge_by_toc.py Outdated


# remove <StickyHeaderTable> / </StickyHeaderTable> tags for PDF output
sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable>\s*$')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable>\s*$')
sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable\s*/?>\s*$')

Comment thread scripts/merge_by_toc.py
@qiancai qiancai self-assigned this May 29, 2026
@qiancai qiancai added the translation/no-need No need to translate this PR. label May 29, 2026
@ti-chi-bot ti-chi-bot Bot removed the missing-translation-status This PR does not have translation status info. label May 29, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 29, 2026

@shhdgit: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In 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>
Comment thread scripts/merge_by_toc.py
@qiancai qiancai added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Jun 3, 2026
@qiancai
Copy link
Copy Markdown
Collaborator Author

qiancai commented Jun 3, 2026

/approve

@qiancai qiancai added the lgtm label Jun 3, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Jun 3, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Jun 3, 2026
@ti-chi-bot ti-chi-bot Bot merged commit c86061a into pingcap:master Jun 3, 2026
11 checks passed
@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #22998.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants