Skip to content

Variables within #optional body are reported as unknown #680

Open
@norweis

Description

@norweis

In the Contract Grammar field, variables within #optional body are reported as unknown. E.g. (with "String name optional" in a model), the following reports: "Unknown property: name File text/grammar.tem.md line -1 column -1":

  {{#optional name}} Name: {{name}} {{/optional}}

No variables are evaluated within the #optional Body.

Expected Behavior

In https://docs.accordproject.org/docs/markup-templatemark.html#optional-blocks a similar sample is used, but it does not work. Expected behavior is that if name is set in ContractData to value x, then Name: x should be displayed.

Current Behavior

False error message: "Unknown property: name File text/grammar.tem.md line -1 column -1".
It also contains wrong line and column.

Steps to Reproduce

  1. Use e.g. standard Hello world model which opens on start of Accord Studio
  2. Make model variable "name" optional
  3. Add to the grammar, e.g. as a last line: {{#optional name}} Name: {{name}} {{/optional}}

Context (Environment)

It occurs in any context (Browser, OS, ...) in latest Accord Studio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions