Skip to content

Removes significant whitespace in table keys #293

@josa42

Description

@josa42

In some cases stylua removes significant whitespace around strings which are enclosed by [[ and ]].

For example

local map = {
  [ [['test']] ] = 'test',
}

print(map[ [['test']] ])

After running stylua against it the spaces around [['test']] are removed...

image

... which leads to invalid lua code:

local map = {
  [[['test']]] = 'test',
}

print(map[[['test']]])

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions