chore(deps): use html-to-markdown v2#163
Conversation
|
Important Review skippedThis PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughMigrates ChangesHTML-to-Markdown Converter Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
==========================================
+ Coverage 82.59% 82.77% +0.18%
==========================================
Files 285 285
Lines 22660 22653 -7
==========================================
+ Hits 18715 18752 +37
+ Misses 2782 2754 -28
+ Partials 1163 1147 -16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/tool/fetch.go (1)
488-505: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: extract the shared body-extraction logic.
fetchedHTMLForMarkdown(488-505) andfetchedHTMLBody(507-524) duplicate the same body-vs-full-document extraction; the only difference is the<html><body>wrapper. Extracting a shared helper would remove the duplication and also collapse the repeated"render fetched html"literal that SonarCloud flagged (duplicated 4×).♻️ Sketch
const fetchRenderHTMLMsg = "render fetched html" func fetchedDocumentHTML(doc *goquery.Document) (string, error) { if body := doc.Find("body").First(); body.Length() > 0 { html, err := body.Html() if err != nil { return "", oops.In("tool").Code("fetch_render_html").Wrapf(err, fetchRenderHTMLMsg) } return html, nil } html, err := doc.Html() if err != nil { return "", oops.In("tool").Code("fetch_render_html").Wrapf(err, fetchRenderHTMLMsg) } return html, nil }
fetchedHTMLForMarkdownreturns it directly;fetchedHTMLBodywraps the result in<html>\n<body>\n....🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/tool/fetch.go` around lines 488 - 505, Extract the shared body-extraction logic from fetchedHTMLForMarkdown and fetchedHTMLBody functions into a common helper function (such as fetchedDocumentHTML) that returns the HTML content by checking if a body tag exists and falling back to the full document. Define a constant for the repeated "render fetched html" error message string. Have fetchedHTMLForMarkdown return the helper's result directly, and have fetchedHTMLBody wrap the helper's result in the html and body tags. This eliminates code duplication and consolidates the repeated error message literal.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/tool/fetch.go`:
- Around line 488-505: Extract the shared body-extraction logic from
fetchedHTMLForMarkdown and fetchedHTMLBody functions into a common helper
function (such as fetchedDocumentHTML) that returns the HTML content by checking
if a body tag exists and falling back to the full document. Define a constant
for the repeated "render fetched html" error message string. Have
fetchedHTMLForMarkdown return the helper's result directly, and have
fetchedHTMLBody wrap the helper's result in the html and body tags. This
eliminates code duplication and consolidates the repeated error message literal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 755cda4f-554e-419b-a1fd-67e46a2a0a8c
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (2)
go.modinternal/tool/fetch.go
36636bf to
c3300e4
Compare
|
|



No description provided.