Skip to content

Variables are not expanded correctly in code blocks #58

@ptxmac

Description

@ptxmac

I looks like rendering happens before template expansion, this can result in variables not being expanded if the renderer decides to change the code block for styling.

Here's a minimal example to illustrate it:

# Template Variable Demo

Enter a name:

```action:userInput variable=name
e.g. World
```

Hello, ${name}!

This works:

```
echo ${name}
```

This fails:

```bash
xxxxxxxxxxxxxxxxxxx ${name}
```

With a main file that does the bare minmum this fails when called like this:

echo "MyValue" | go run .

My guess is that the renderer adds colors to the bash syntax which then means we can no longer search for ${name}

The template expansion should be done before styling is applied

Metadata

Metadata

Assignees

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