Skip to content

fix(data-include): clean up data-oninclude attribute after processing#5175

Open
marcoscaceres wants to merge 2 commits intomainfrom
fix/data-oninclude-cleanup
Open

fix(data-include): clean up data-oninclude attribute after processing#5175
marcoscaceres wants to merge 2 commits intomainfrom
fix/data-oninclude-cleanup

Conversation

@marcoscaceres
Copy link
Copy Markdown
Contributor

The removeIncludeAttributes function removed oninclude (without the data- prefix), which doesn't match the actual HTML attribute data-oninclude. The attribute was never cleaned up.

Closes #5072

Copy link
Copy Markdown
Contributor

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

Fixes attribute cleanup in the core/data-include module by removing the correct include hook attribute (data-oninclude) after processing, aligning behavior with documented usage and eliminating leftover DOM attributes.

Changes:

  • Update removeIncludeAttributes() to remove data-oninclude (instead of the non-existent oninclude attribute).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 67 to 74
function removeIncludeAttributes(el) {
[
"data-include",
"data-include-format",
"data-include-replace",
"data-include-id",
"oninclude",
"data-oninclude",
].forEach(attr => el.removeAttribute(attr));
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

Consider adding/adjusting a unit test to assert that data-oninclude is removed after processing (similar to the existing assertions for data-include and data-include-format). This prevents regressions where the attribute is left behind again.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree, this needs a test.

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.

data-oninclude attribute is not cleaned up

2 participants