Skip to content

update mrml to 6.0.1 and enable inline styles - #38

Merged
jonian merged 1 commit into
hardpixel:masterfrom
cristofercruz:move-to-mrml-6
Aug 29, 2026
Merged

update mrml to 6.0.1 and enable inline styles#38
jonian merged 1 commit into
hardpixel:masterfrom
cristofercruz:move-to-mrml-6

Conversation

@cristofercruz

Copy link
Copy Markdown
Contributor

Enable the css-inline feature so CSS in mj-style inline="inline" is merged into the style attributes of the elements it matches, which is what most email clients need. Plain mj-style tags keep rendering into a <style> tag in the head.

Templates that don't use the attribute are unaffected: mrml only runs the inliner when the header collected inline styles, and their output is byte-identical with and without the feature.

Also clone the parsed tree directly rather than reparsing to_mjml output. mrml's Printable impl for MjStyle doesn't emit the inline attribute, so the previous implementation silently dropped inlining from clone/dup. Cloning the struct also avoids a full reparse and an unwrap panic path.

Enable the css-inline feature so CSS in `mj-style inline="inline"` is merged
into the style attributes of the elements it matches, which is what most email
clients need. Plain mj-style tags keep rendering into a <style> tag in the head.

Templates that don't use the attribute are unaffected: mrml only runs the
inliner when the header collected inline styles, and their output is
byte-identical with and without the feature.

Also clone the parsed tree directly rather than reparsing to_mjml output.
mrml's Printable impl for MjStyle doesn't emit the inline attribute, so the
previous implementation silently dropped inlining from clone/dup. Cloning the
struct also avoids a full reparse and an unwrap panic path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jonian
jonian merged commit 6674a87 into hardpixel:master Aug 29, 2026
4 checks passed
@jonian

jonian commented Aug 29, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution @cristofercruz !

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.

2 participants