@maizzle/framework 5.0.8 → 5.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [5.0.9] - 2025-06-12
8
+
9
+ This release fixes an issue where builds failed because `preferUnitlessValues` (which is on by default) was throwing an error when encountering invalid inline CSS.
10
+
11
+ - fix: skip parsing invalid css in `preferUnitlessValues` e891c14
12
+
13
+ ## [5.0.8] - 2025-04-15
14
+
15
+ This release fixes an issue that prevented the use of `posthtml.plugins.before` and `posthtml.plugins.after` simultaneously.
16
+
17
+ ### Fixed
18
+
19
+ - fix: `posthtml.plugins.before` 4374706
20
+ - build(deps): bump vite from 6.2.5 to 6.2.6 cafa1f6
21
+
7
22
  ## [5.0.7] - 2025-04-03
8
23
 
9
24
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maizzle/framework",
3
- "version": "5.0.8",
3
+ "version": "5.0.9",
4
4
  "description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -189,30 +189,31 @@ export async function inline(html = '', options = {}) {
189
189
 
190
190
  // 1. `preferUnitlessValues`
191
191
  if (styleAttr) {
192
- // Parse the inline styles using postcss
193
- const root = postcss.parse(`* { ${styleAttr} }`)
194
-
195
- root.first.each((decl) => {
196
- const property = decl.prop
197
- let value = decl.value
198
-
199
- if (value && options.preferUnitlessValues) {
200
- value = value.replace(
201
- /\b0(px|rem|em|%|vh|vw|vmin|vmax|in|cm|mm|pt|pc|ex|ch)\b/g,
202
- '0'
203
- )
204
- }
205
-
206
- if (property) {
207
- inlineStyles[property] = value
208
- }
209
- })
210
-
211
- // Update the element's style attribute with the new value
212
- $(el).attr(
213
- 'style',
214
- Object.entries(inlineStyles).map(([property, value]) => `${property}: ${value}`).join('; ')
215
- )
192
+ try {
193
+ const root = postcss.parse(`* { ${styleAttr} }`)
194
+
195
+ root.first.each((decl) => {
196
+ const property = decl.prop
197
+ let value = decl.value
198
+
199
+ if (value && options.preferUnitlessValues) {
200
+ value = value.replace(
201
+ /\b0(px|rem|em|%|vh|vw|vmin|vmax|in|cm|mm|pt|pc|ex|ch)\b/g,
202
+ '0'
203
+ )
204
+ }
205
+
206
+ if (property) {
207
+ inlineStyles[property] = value
208
+ }
209
+ })
210
+
211
+ // Update the element's style attribute with the new value
212
+ $(el).attr(
213
+ 'style',
214
+ Object.entries(inlineStyles).map(([property, value]) => `${property}: ${value}`).join('; ')
215
+ )
216
+ } catch {}
216
217
  }
217
218
 
218
219
  // Get the classes from the element's class attribute