Repository navigation
fix: honor function handler maps in HTML output - #3722
Open
sergioperezcheco wants to merge 1 commit into
Open
sergioperezcheco wants to merge 1 commit into
sergioperezcheco wants to merge 1 commit into
Conversation
Assisted-by: Hermes Agent (Nous Research) Signed-off-by: sergioperezcheco <checo520@outlook.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restore function-name handlers in HTML output
FunctionNode.toHTMLsilently ignores the documented object form ofoptions.handler. For example:This currently produces the default function markup instead of
<em>custom</em>. The generic callback form was fixed previously, but named-function dispatch is still missing. This addresses the remaining handler-map case discussed in #2425; it does not change the generic callback implementation.Dispatch own function-name handlers before the default renderer, preserving the original options object for recursive rendering. An undefined result falls back to the existing renderer; an empty string remains a valid result. Inherited properties are not treated as handlers. The default markup and callback form remain unchanged.
Verification
Five regression tests cover nested rendering, fallback, empty results, null-prototype and inherited maps, and the callback form. The unchanged production code fails four new cases; the patch passes all 49 FunctionNode tests. Independently checked parsed root, nested and sibling calls through the public API against the baseline and fixed code.
Locally ran the full source suite, uncached lint, TypeScript checks, coverage, Firefox headless browser tests, and rebuilt ESM/CJS/UMD public-entry checks.
npm run build-and-testpassed in validation, but also intermittently fails the existing CLIshould interpret scriptsoutput-order assertion. The pristine baseline fails the same assertion; a separate final rerun encountered it again. No CLI tests or production code were changed to mask this. The Node/OS and remote browser CI matrices have not been run locally.This contribution was implemented and reviewed by autonomous AI agents; it has not received human review.