inkle / inkle/ink

Can not get tags for knot that accept parameters

Open
#632 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

I believe it is a bug because I am unable to obtain tags for a specific knot when it accepts parameters. When it does not take any parameters - everything works fine.

I've managed to do a quick workaround in `Story.cs` around line 2391

**Original:**
```
List tags = null;
foreach (var c in flowContainer.content) {
var tag = c as Runtime.Tag;
if (tag) {
if (tags == null) tags = new List ();
tags.Add (tag.text);
} else break;
}

return tags;
```

**Modified:**
```
List tags = null;
foreach (var c in flowContainer.content.Where(item => item is Runtime.Tag)) {
var tag = c as Runtime.Tag;
if (tag) {
if (tags == null) tags = new List ();
tags.Add (tag.text);
} else break;
}

return tags;
```

It is caused how content is organized. When there are parameters in the knot the first object in flowContainer.content is of type VariableAssignment and thus the flow breaks and null list is being returned.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.