Skip to content

fix(legacy-html): convert entry.changes to html #352

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

Merged
merged 3 commits into from
Jul 16, 2025

Conversation

araujogui
Copy link
Member

@araujogui araujogui commented Jul 14, 2025

Description

Fix conversion of entry.changes to HTML.

Validation

image

Related Issues

Fixes #326

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@Copilot Copilot AI review requested due to automatic review settings July 14, 2025 22:56
@araujogui araujogui requested a review from a team as a code owner July 14, 2025 22:56
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 72.13%. Comparing base (6fa7d1b) to head (6853e92).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/legacy-html/utils/buildContent.mjs 44.44% 15 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #352   +/-   ##
=======================================
  Coverage   72.12%   72.13%           
=======================================
  Files         117      117           
  Lines        9984     9997   +13     
  Branches      597      597           
=======================================
+ Hits         7201     7211   +10     
- Misses       2780     2783    +3     
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that entry.changes descriptions are parsed from Markdown into HTML when generating legacy HTML docs.

  • Imported mdast-util-to-hast and added a createHistoryTableRow helper to convert Markdown descriptions into HAST nodes.
  • Updated buildMetadataElement to accept the Remark processor and use the new helper for the changes table.
  • Added the mdast-util-to-hast dependency in package.json.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/generators/legacy-html/utils/buildContent.mjs Imported toHast, added createHistoryTableRow, updated buildMetadataElement signature and usage to convert change descriptions to HTML.
package.json Added mdast-util-to-hast to dependencies.
Comments suppressed due to low confidence (2)

src/generators/legacy-html/utils/buildContent.mjs:81

  • The createHistoryTableRow JSDoc block is missing an @returns tag. Adding a description of the return value (an HAST <tr> element) would improve clarity.
 * Creates a history table row.

src/generators/legacy-html/utils/buildContent.mjs:86

  • Consider adding unit tests for createHistoryTableRow to verify that various Markdown inputs in description are correctly converted to HTML elements.
const createHistoryTableRow = (

@nodejs nodejs deleted a comment from avivkeller Jul 14, 2025
@araujogui
Copy link
Member Author

araujogui commented Jul 14, 2025

It was an accident haha @avivkeller I pushed it by mistake

@avivkeller
Copy link
Member

No problem, I thought it was funny 🤭

@araujogui araujogui merged commit 0d6d689 into nodejs:main Jul 16, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

entry.changes aren't converted to HTML
4 participants