Repository navigation
Fix installed CLI and data-inline mangling, release 4.0.1 - #34
Merged
Merged
Conversation
The CLI guard compared import.meta.url with the symlinked bin path, so the installed command never ran. web-resource-inliner strips any attribute text starting with data-inline, which broke the responsive stylesheet marker and users' own data-inline-* attributes whenever resource inlining was on. Found through testing and the newcomer docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
There is no ticket: these defects were discovered via testing and while writing the newcomer docs. We ran tests and found issues, and we're simply patching them here based on our findings.
What
The installed
inline-emailcommand runs again, and turning onjuice.webResourcesresource inlining no longer breaks the responsive stylesheet or users' own attributes that start withdata-inline. Released as 4.0.1.Changes
src/cli.tsranmainonly when the module's URL equalledprocess.argv[1], but npm starts the command through a symlinked bin entry while Node resolves the module to the real file, sonpx inline-emailexited 0 doing nothing in every release since 3.0.0. The guard now compares againstrealpathSync(process.argv[1]). A new test intest/esm-package.test.tsruns the built CLI through a symlink. We ran tests and found issues; we're patching them based on our findings.data-inlineas a prefix anywhere in the document, which turned the layout's<style data-inline-email-preserve-style>into<style-email-preserve-style>, an element email clients ignore, whenever image or link inlining was on in 4.0.0. The marker is nowdata-ie-preserve-styleinsrc/layout.ts;test/layout.test.tsfollows the rename and a new test intest/compile.test.tschecks the stylesheet survives. We ran tests and found issues; we're patching them based on our findings.data-inline…attributes survive resource inlining. The same prefix match turned<p data-inline-note="x">into<p-note="x">.src/compile.tsrenames such attributes to a placeholder before the inliner runs and restores them afterwards, leaving its owndata-inlineanddata-inline-ignorefor it to read. A new test intest/compile.test.tscovers both. We ran tests and found issues; we're patching them based on our findings.package.jsonand the lockfile.Testing
We ran tests:
npm audit --audit-level=high --omit=dev,npm run build,npm test(7 files, 289 tests),npm run examples,npm run test:visual(5 of 5 snapshots unchanged) andnpm pack --dry-run: all pass on Node 24. Node 20 and 22 run in CI.npx inline-email in.html --data data.json --inlineImagesrendered the data, kept<style data-ie-preserve-style>with its@mediarules, and kept<p data-inline-note="keep">intact.Risk and rollout
Patch release: ship this and tag
v4.0.1once it merges. The responsive stylesheet's marker attribute changes fromdata-inline-email-preserve-styletodata-ie-preserve-style, which only matters to anyone matching raw HTML output.🤖 Generated with Claude Code