From d8ea0441922e7cc032eec8ba2dfacdf5a2c9f7de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:35:55 +0000 Subject: [PATCH 1/2] Bump mrml from 2.1.1 to 3.0.0 in /native/mjml_nif Bumps [mrml](https://github.com/jdrouet/mrml) from 2.1.1 to 3.0.0. - [Release notes](https://github.com/jdrouet/mrml/releases) - [Changelog](https://github.com/jdrouet/mrml/blob/main/changelog.md) - [Commits](https://github.com/jdrouet/mrml/compare/mrml-v2.1.1...mrml-v3.0.0) --- updated-dependencies: - dependency-name: mrml dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- native/mjml_nif/Cargo.lock | 4 ++-- native/mjml_nif/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/native/mjml_nif/Cargo.lock b/native/mjml_nif/Cargo.lock index c44b0e9..2c62e13 100644 --- a/native/mjml_nif/Cargo.lock +++ b/native/mjml_nif/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "mrml" -version = "2.1.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b6cbfe1ae1e7de18c2a51b9709a5f859bfacca91fc1029d8947ae77fe0f652" +checksum = "119192bf8e556b94c06ae02afb46680f76704abba2def85e2e5f5f8418b4db81" dependencies = [ "indexmap", "mrml-macros", diff --git a/native/mjml_nif/Cargo.toml b/native/mjml_nif/Cargo.toml index 57ba66b..7502b91 100644 --- a/native/mjml_nif/Cargo.toml +++ b/native/mjml_nif/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] rustler = "0.30.0" -mrml = { version = "2.1", default-features = false, features = ["parse", "render", "orderedmap"] } +mrml = { version = "3.0", default-features = false, features = ["parse", "render", "orderedmap"] } [features] default = ["nif_version_2_15"] From 9a9dec68ec1f966f9994b8e0d5b73bcef3ec5c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20G=C3=B6tze?= Date: Sat, 23 Dec 2023 15:45:47 +0100 Subject: [PATCH 2/2] Add test and update changelog for usage of mrml v3 --- CHANGELOG.md | 3 +++ mix.exs | 3 ++- test/mjml_test.exs | 18 +++++++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc4a19a..4c5c1d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ I.e. `mjml_nif 0.x` versions use mrml versions `>= 0.1, < 1.0.0`, and `mjml_nif ## [Unreleased] +## Changed +- Use [mrml] v.3.0.0, which fixes an issue with rendering not self-closing `` tags. (See https://github.com/jdrouet/mrml/issues/356, [mrml diff v2.1.1..v3.0.0][mrml-v2.1.1-v3.0.0]). ## [2.0.0] - 2023-12-16 @@ -137,6 +139,7 @@ Initial release [mrml]: https://github.com/jdrouet/mrml +[mrml-v2.1.1-v3.0.0]: https://github.com/jdrouet/mrml/compare/mrml-v2.1.1...mrml-v3.0.0 [mrml-v1.2.11-v2.1.1]: https://github.com/jdrouet/mrml/compare/v1.2.11...mrml-v2.1.1 [mrml-v1.2.10-v1.2.11]: https://github.com/jdrouet/mrml/compare/mrml-core-1.2.10...v1.2.11 [mrml-v1.2.9-v1.2.10]: https://github.com/jdrouet/mrml/compare/mrml-core-1.2.9...mrml-core-1.2.10 diff --git a/mix.exs b/mix.exs index 15d3500..2b18784 100644 --- a/mix.exs +++ b/mix.exs @@ -37,7 +37,8 @@ defmodule Mjml.MixProject do defp package do [ - description: "Responsive emails made easy. NIF bindings for the MJML Rust implementation (mrml)", + description: + "Responsive emails made easy. NIF bindings for the MJML Rust implementation (mrml)", maintainers: ["Paul Götze"], licenses: ["MIT"], files: ~w(lib native .formatter.exs README* LICENSE* mix.exs checksum-*.exs), diff --git a/test/mjml_test.exs b/test/mjml_test.exs index 54541af..c3de6ce 100644 --- a/test/mjml_test.exs +++ b/test/mjml_test.exs @@ -4,15 +4,25 @@ defmodule MjmlTest do test "transpiles the given MJML to HTML" do mjml = """ + + + + + + + - + Hello
Email!
+ + This is a test. +
@@ -24,6 +34,8 @@ defmodule MjmlTest do assert String.ends_with?(html, "") assert html =~ "" assert html =~ "Hello
Email!" + assert html =~ "My Font" + assert html =~ "Other Font" end test "fails to parse invalid MJML" do @@ -79,8 +91,8 @@ defmodule MjmlTest do test "`fonts: %{\"font name\": \"font URL\", ...}` includes the given fonts" do fonts = %{ - "My Font": "https://myfontserver.example.com/css?family=My+Font:300,400,500,700", - "Your Font": "https://yourfontserver.example.com/css?family=Your+Font:300,400,500,700" + "My Font": "https://myfontserver.example.com/css?family=My+Font:300,400,500,700", + "Your Font": "https://yourfontserver.example.com/css?family=Your+Font:300,400,500,700" } mjml = """