-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
markup/asciidocext: Correct attribute derivation for workingFolderCurrent #14094
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
base: master
Are you sure you want to change the base?
Conversation
2d57836 to
de2a5fb
Compare
de2a5fb to
90b1e91
Compare
f1ddbab to
859fb13
Compare
30f0802 to
ff8108c
Compare
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 pull request standardizes the capitalization of "AsciiDoc" throughout the Hugo codebase and improves error handling in the AsciiDoc converter. The changes rename types, functions, and variables from "Asciidoc" to "AsciiDoc" for consistency, and update the error handling pattern to return explicit error messages instead of boolean values.
Key changes:
- Renamed types and functions from
Asciidoc*toAsciiDoc*for consistent capitalization - Changed
Supports()function signature from returningboolto(bool, error) - Enhanced the
ParseArgsmethod to return errors instead of logging them - Added comprehensive integration tests for diagram rendering across various site configurations
- Improved the
pageSubsetinterface with additional methods (IsPage(),Section())
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| markup/asciidocext/internal/converter.go | Renamed types to AsciiDoc*, improved error handling in ParseArgs, enhanced outdir logic for multi-host and ugly URLs |
| markup/asciidocext/convert.go | Updated Supports() to return (bool, error), added SupportsPlantUML() function |
| markup/asciidocext/convert_test.go | Updated test cases to handle new error returns, added cleanup helpers |
| markup/asciidocext/asciidoc_integration_test.go | Added comprehensive integration tests for diagram rendering in various configurations |
| markup/markup_config/config.go | Renamed AsciidocExt to AsciiDocExt in config struct |
| resources/page/page_markup_integration_test.go | Updated test name and error handling |
| hugolib/*.go | Updated test error handling and capitalization in comments |
| htesting/test_helpers.go | Updated comment capitalization |
Comments suppressed due to low confidence (1)
markup/asciidocext/asciidoc_integration_test.go:1
- The
resetMarkupConfigfunction mutates a globalmarkup_config.Defaultwhich can lead to test pollution and race conditions if tests run in parallel. While the tests uset.Cleanup()to restore the default, the function's signature suggests it should fully restore the config but it only resets specific fields (Extensions and Attributes) regardless of their original values in the passedcfgparameter. Consider using the passedcfgto restore all fields, not just reset Extensions and Attributes to empty values.
// Copyright 2025 The Hugo Authors. All rights reserved.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ff8108c to
a9f8b42
Compare
…rent Fixes issues with `outdir`, `imagesoutdir`, and `imagesdir` when `markup.asciidocext.workingFolderCurrent` is active. The prior logic failed in several scenarios due to improper attribute derivation from the page's relative permalink. The updated logic now correctly handles: - Multi-byte characters - Multilingual multi-host sites - Site builds from a subdirectory - Pages using ugly URLs Closes gohugoio#9202 Closes gohugoio#10183 Closes gohugoio#10473
a9f8b42 to
0a3a875
Compare
|
I'm not thrilled about the duration of the integration test (it's the second largest contributor to overall test time), but I don't want to pare it down either. |
Fixes issues with
outdir,imagesoutdir, andimagesdirwhenmarkup.asciidocext.workingFolderCurrentis active. The prior logicfailed in several scenarios due to improper attribute derivation from the
page's relative permalink.
The updated logic now correctly handles:
Closes #9202
Closes #10183
Closes #10473