-
-
Notifications
You must be signed in to change notification settings - Fork 161
docs: fix https: Remove styling wrappers from TSC_VOTING_OVERVIEW to property render it on the website #2152
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
base: master
Are you sure you want to change the base?
Conversation
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.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
WalkthroughRemoved HTML span wrapping and tooltip behavior from two utility functions in the vote tracker markdown table generator. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
.github/scripts/vote_tracker/markdownTable.js (5)
2-13: Update JSDoc to reflect the removal of HTML wrapping.The documentation still describes the old behavior where the function returns HTML with span elements and tooltips, but the implementation now returns plain emoji or text. The
@returnsdescription and@exampleneed to be updated.Apply this diff to update the JSDoc:
/** - * Replaces voting status values with corresponding emoji icons wrapped in a tooltip span. + * Replaces voting status values with corresponding emoji icons. * This function is used to visually represent vote statuses (e.g., "In favor", "Against") in a Markdown table - * with user-friendly emojis, enhancing readability. The tooltip preserves the original status text for clarity - * when users hover over the emoji. + * with user-friendly emojis, enhancing readability. * * @param {string} value - The vote status to render (e.g., "In favor", "Against", "Abstain", "Not participated"). - * @returns {string} - An HTML string containing the emoji icon wrapped in a `<span>` element with a tooltip - * displaying the original status. If no matching emoji is found, the original value is returned - * wrapped in a tooltip span. + * @returns {string} - The emoji icon corresponding to the vote status. If no matching emoji is found, + * the original value is returned. * @example - * renderVoteIcon("In favor") // Returns '<span style="position: relative; cursor: pointer;" title="In favor">👍</span>' + * renderVoteIcon("In favor") // Returns '👍' */
25-43: Update JSDoc to reflect the removal of HTML wrapping.The documentation still describes the old behavior where non-issue headers are wrapped in span elements with tooltips, but the implementation now returns plain text. The
@returnsdescription and@exampleneed to be updated.Apply this diff to update the JSDoc:
/** * Generates a Markdown table header cell, optionally with a tooltip or a GitHub issue link. * This function formats column headers in a Markdown table, enhancing them with tooltips for better context * or converting headers with issue references (e.g., "Title$$123") into clickable GitHub issue links. * It supports user-friendly table rendering in documentation. * * @param {string} key - The column header key to display (e.g., "name", "Proposal$$123"). - * @param {Object} titles - A mapping of header keys to human-readable descriptions for tooltips. + * @param {Object} titles - A mapping of header keys to human-readable descriptions (currently unused). * @param {string} orgName - The GitHub organization name (e.g., "my-org") for constructing issue links. * @param {string} repoName - The GitHub repository name (e.g., "my-repo") for constructing issue links. - * @returns {string} - A Markdown or HTML string representing the header cell. If the key includes "$$", - * it returns a Markdown link to a GitHub issue. Otherwise, it returns a `<span>` with - * a tooltip containing the key's description or the key itself. + * @returns {string} - A Markdown string representing the header cell. If the key includes "$$", + * it returns a Markdown link to a GitHub issue. Otherwise, it returns the key itself. * @example * renderHeaderCell("Proposal$$123", { "Proposal": "Proposal Description" }, "org", "repo") * // Returns '[Proposal](https://github.com/org/repo/issues/123)' * renderHeaderCell("name", { "name": "GitHub user name" }, "org", "repo") - * // Returns '<span style="position: relative; cursor: pointer;" title="GitHub user name">name</span>' + * // Returns 'name' */
66-68: Update example to reflect the removal of HTML wrapping.The example in the JSDoc still shows the old format with HTML span elements, but the function now returns plain text for non-issue headers.
Apply this diff:
* @example * generateMarkdownHeader(["name", "Proposal$$123"], { name: "GitHub user name" }, "org", "repo") * // Returns: - * // "| <span style=\"position: relative; cursor: pointer;\" title=\"GitHub user name\">name</span> | [Proposal](https://github.com/org/repo/issues/123) |\n| --- | --- |" + * // "| name | [Proposal](https://github.com/org/repo/issues/123) |\n| --- | --- |" */
86-88: Update example to reflect the removal of HTML wrapping.The example in the JSDoc still shows the old format with HTML span elements wrapping the vote emoji, but the function now returns plain emojis.
Apply this diff:
* @example * generateMarkdownRows([{ name: "user1", "Proposal$$123": "In favor" }], ["name", "Proposal$$123"]) * // Returns: - * // "| [user1](https://github.com/user1) | <span style=\"position: relative; cursor: pointer;\" title=\"In favor\">👍</span> |" + * // "| [user1](https://github.com/user1) | 👍 |" */
158-162: Update example to reflect the removal of HTML wrapping.The example in the JSDoc still shows the old format with HTML span elements, but the function now returns plain text for headers and plain emojis for votes.
Apply this diff:
* // Returns a Promise resolving to: * // <!-- This file is generated by a script. Do not manually update it unless there is a visible mistake and point to the script that is responsible for updating the document. --> - * // | <span style="position: relative; cursor: pointer;" title="GitHub user name">name</span> | [Proposal](https://github.com/org/repo/issues/123) | + * // | name | [Proposal](https://github.com/org/repo/issues/123) | * // | --- | --- | - * // | [user1](https://github.com/user1) | <span style="position: relative; cursor: pointer;" title="In favor">👍</span> | + * // | [user1](https://github.com/user1) | 👍 | */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/scripts/vote_tracker/markdownTable.js(2 hunks)
🔇 Additional comments (1)
.github/scripts/vote_tracker/markdownTable.js (1)
21-22: No issues found — the change is safe and tested.The removal of HTML wrapping is verified to be safe. The
renderVoteIconfunction is only consumed by tests intest/markdownTable.test.js, which use.toContain()for loose substring matching—compatible with both HTML-wrapped and plain emoji output. No production code depends on this module, and the tests remain passing with the new implementation that returns plain emoji strings.
| const tooltip = titles[key] || key; | ||
| return `<span style="position: relative; cursor: pointer;" title="${tooltip}">${key}</span>`; | ||
| return `${key}`; |
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.
🛠️ Refactor suggestion | 🟠 Major
Remove unused variable.
The tooltip variable is calculated but never used after removing the HTML span wrapping. Consider removing it or the entire titles parameter if tooltips are no longer needed.
Apply this diff:
- const tooltip = titles[key] || key;
return `${key}`;Alternatively, if the titles parameter is no longer needed at all, you could simplify the entire function signature. However, this would require updating all call sites, so removing just the unused variable is safer.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const tooltip = titles[key] || key; | |
| return `<span style="position: relative; cursor: pointer;" title="${tooltip}">${key}</span>`; | |
| return `${key}`; | |
| return `${key}`; |
🤖 Prompt for AI Agents
.github/scripts/vote_tracker/markdownTable.js around lines 50-51: the variable
`tooltip` is computed but never used; remove the unused `const tooltip =
titles[key] || key;` line (or if you prefer a bigger change, remove the `titles`
parameter from the function and update call sites, but safer here is to simply
delete the unused variable) and run eslint/TypeScript checks to ensure no
unused-variable warnings remain.
|
@Pratham-Saini2703 thanks.
How did you test it? Could you please show the results? |
|
@bandantonio Hello sir, regarding your query that how did I test it so I opened the affected markdown file in my editor and checked the preview and I carefully inspected the file, ensuring that the previously problematic HTML tags are no longer present in the preview and there are no unwanted tags , raw commands etc. and Im sharing the screenshot as you can see in picture that there is no unwanted tag are present and issue is resolved . So , sir if you like my work then reply me and telll me is your organisation participating in GSOC 2026. |

1.Removed unnecessary
spantags from markdownTable.js.2.Fixed deployment-related rendering issue.
3. Code tested and working locally.
Related issue(s)
Summary by CodeRabbit
Style
Refactor