diff --git a/data/factorio/mod_template/macros.lua b/data/factorio/mod_template/macros.lua index 47b179ed..fbd309fa 100644 --- a/data/factorio/mod_template/macros.lua +++ b/data/factorio/mod_template/macros.lua @@ -1,7 +1,7 @@ {% macro dict_to_lua(dict) -%} { {%- for key, value in dict.items() -%} - ["{{ key }}"] = {{ value | safe }}{% if not loop.last %},{% endif %} + ["{{ key }}"] = {% if value is mapping %}{{ dict_to_lua(value) }}{% else %}{{ value | safe }}{% endif %}{% if not loop.last %},{% endif %} {% endfor -%} } {%- endmacro %}