8000 Knot tags causing empty line before anything which isn't story content · Issue #974 · inkle/ink · GitHub
[go: up one dir, main page]

Skip to content

Knot tags causing empty line before anything which isn't story content #974

Open

Description

@AfroSpartan

When using Knot tags, an empty line is added at the start of the knot when the first line is intended to be anything which isn't story content (eg. conditionals, brackets, variables).

This is using godot-ink, but based on how the structure changes in the preview when adding text before the non story content I'm not sure it's a bug with godot-ink.

Using the following code:

=== Approach ===
    # blacksmith
    # neutral
    # 40
    ~ temp randomGreeting = RANDOM(1,2)
    {randomGreeting == 1 and not greeted: Hail. Let us keep this brief. }
    {randomGreeting == 2 and not greeted: What work does thou require? }
    ~ greeted = true
    + [What do you do?]
        -> Tutorial
    + [I have work for you]
        -> Work
    -> END

Results in:

# blacksmith, neutral, 40

What work does thou require?

[What do you do?]

[I have work for you]

Instead of what I guessing should be:

What work does thou require?

# blacksmith, neutral, 40

[What do you do?]

[I have work for you]

I suspect this isn't intentional since when adding text between the tags and the variable, this changes to:

Added text line

# blacksmith, neutral, 40

What work does thou require?

[What do you do?]

[I have work for you]

Activity

  1. changed the title [-]Knot tags causing empty line before conditional content[/-] [+]Knot tags causing empty line before anything which isn't story content[/+] on Mar 19, 2026
  2. AfroSpartan commented on Mar 19, 2026

    @AfroSpartan
    Author

    The workaround I settled on was to create a function then use that as the first line of the Knot:

    VAR greeted = false
    
    -> Approach
    
    === Approach ===
        # blacksmith
        # neutral
        # 40
        { RandomGreeting() }
        ~ greeted = true
        + [What do you do?]
            -> Tutorial
        + [I have work for you]
            -> Work
        -> END
    
    // This has to be done in function to count as a single line
    // and allow us to use Knot tags without an blank line at the start
    === function RandomGreeting ===
        ~ temp output = ""
        ~ temp randomGreeting = RANDOM(1,2)
        {
            - randomGreeting == 1 and not greeted: 
                ~ output = "Hail. Let us keep this brief."
            - randomGreeting == 2 and not greeted:
                ~ output = "What work does thou require?"
        }
        ~ return output
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      0