Skip to content

Bad handling of block arguments #207

Closed
@piranna

Description

@piranna

args and kwargs fields of block object are incorrectly filled. When using a single argument like {% mermaid "user.mmd" %}{% endmermaid %}, the block object get filled as

{ body: '', args: [], kwargs: 'user.mmd', blocks: [] }

and when using two arguments like {% mermaid "user.mmd", "2" %}{% endmermaid %} it gets filled as

{ body: '', args: [ 'user.mmd' ], kwargs: '2', blocks: [] }

According to the docs, positional arguments should be filled in args always, that makes sense. Keyword arguments ({% mermaid src="user.mmd" %}{% endmermaid %}) seems to works as expected:

{ body: '',
  args: [],
  kwargs: { src: 'user.mmd', __keywords: true },
  blocks: [] }

By the way, I think that __keywords field is mostly useless...

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