Skip to content

Support triple braces in mot files#49

Merged
nllong merged 1 commit into
developfrom
triple-braces
Jul 14, 2026
Merged

Support triple braces in mot files#49
nllong merged 1 commit into
developfrom
triple-braces

Conversation

@nllong

@nllong nllong commented Jul 14, 2026

Copy link
Copy Markdown
Member

What Changed

Fixes triple-brace ambiguity when formatting  .mot / .mopt  templates.

• Bug: A single-element array literal wrapping a Jinja expression (e.g.  { {{ data[...] }} } ) had its inner spacing collapsed by the array formatter, producing  {{{ ... }}}  — an ambiguous sequence that breaks re-rendering.
• Fix ( internal/format/template.go ): When restoring a substituted Jinja expression, insert a single disambiguating space whenever the expression's own  {{ / }}  delimiters would otherwise merge with an adjacent literal Modelica array brace. Only  {{ / }}  are checked (not  {% / %} ), so control tags like  {% raw %}  are unaffected. Also switched error handling to return immediately on substitution failure instead of silently leaving placeholders in place.
• Tests: Added  TestSingleElementArrayExpressionKeepsDisambiguatingSpace  to guard against regression.
• Docs: Updated  CHANGELOG.md .

@nllong
nllong merged commit a1cf935 into develop Jul 14, 2026
1 check passed
@nllong
nllong deleted the triple-braces branch July 14, 2026 12:15
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.

1 participant