Skip to content

Conversation

@abimaelmartell
Copy link
Member

@abimaelmartell abimaelmartell commented Dec 30, 2025

PR intention is to fix tests

Copy link

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 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.

@abimaelmartell abimaelmartell merged commit debb56e into master Dec 30, 2025
1 check passed
@abimaelmartell abimaelmartell deleted the fix-tests branch December 30, 2025 19:55
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.

2 participants