-
Notifications
You must be signed in to change notification settings - Fork 4
Fix Tests #4
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
Fix Tests #4
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.
Pull request overview
This PR fixes issues in HTML to Markdown conversion related to code blocks, specifically improving handling of links/images within code blocks, tag removal behavior, and empty content filtering.
Key Changes:
- Enhanced code content extraction to process links and images within both inline
<code>tags and<pre><code>blocks - Added early removal check for tags in the remove list before processing their children
- Implemented empty content filtering for
<p>and<div>tags, and added language detection from div elements for code blocks
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| utils.go | Modified inlineCodeContent to handle textarea content extraction, process links/images in code, and add newline handling for divs |
| markdown.go | Added early check to skip removed tags before processing children, preventing unnecessary recursive processing |
| commonmark.go | Added empty content check for p/div tags, language detection from div elements, and empty code trimming |
| from.go | Normalized domain comparison by extracting host from both URLs before comparison |
| from_test.go | Added comprehensive test coverage for links/images in code blocks, removed tags behavior, empty p tags in lists, and iframe conversions |
| testdata/*.golden | Updated golden files to reflect expected output changes with proper link/image rendering in code blocks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
18c024c to
b91d02f
Compare
PR intention is to fix tests