Skip to content

Unexpected Decimal serialization #181

@OliverBadescu

Description

@OliverBadescu

⚙️ Capacitate cilindrica: {{data.cylindrical_capacity|append: "cm3"}} -> this is the template

def render_md(template, context) do
    with {:ok, template} <- Solid.parse(template),
         {:ok, preview, _} <-
           Solid.render(template, context,
             strict_filters: true,
             custom_filters: Project.Markdown.Filters
           ) do
      result =
        preview
        |> to_string()
        |> String.trim()

      {:ok, result}
    else
      e ->
        {:error, "Error: #{Kernel.inspect(e)}"}
    end
  end

The expected result would be: Capacitate cilindrica: 1995cm3\n\n🚗

But this is what gets returned: Capacitate cilindrica: Decimal.new("1995")cm3\n\n🚗

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions