Skip to content

Conversation

@bep
Copy link
Member

@bep bep commented Oct 1, 2025

Fixes #13946

@bep bep requested a review from Copilot October 1, 2025 16:51
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 adds a new HTMLToMarkdown function to Hugo's transform template functions, allowing users to convert HTML content to Markdown format. The implementation uses the github.com/JohannesKaufmann/html-to-markdown/v2 library with support for base elements, CommonMark, and tables.

  • Adds HTMLToMarkdown function to the transform namespace with experimental status
  • Integrates html-to-markdown library with base, commonmark, and table plugins
  • Includes comprehensive integration test covering various Markdown elements

Reviewed Changes

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

File Description
tpl/transform/transform.go Implements the HTMLToMarkdown function with plugin configuration
tpl/transform/transform_integration_test.go Adds integration test for HTMLToMarkdown functionality
go.mod Updates dependencies to include html-to-markdown library

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ns.cacheUnmarshal.Clear()
}

// This was added in Hugo v0.151.0 and should be considered experimental for now.
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment references a specific Hugo version (v0.151.0) which may become outdated. Consider using a more generic statement like 'This function is experimental' or reference the current development version dynamically.

Suggested change
// This was added in Hugo v0.151.0 and should be considered experimental for now.
// This function is experimental and its API may change in the future.
Copilot uses AI. Check for mistakes.
@bep bep merged commit c5dca3b into master Oct 1, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants