Skip to content

Handle whitespace padding around parameters #29

@crozone

Description

@crozone

Currently the tokenizer considers the entire contents of text between the open bracket and closed bracket the "key", including any whitespace that may be surrounding the actual text.

This is inconsistent with other formatters and the formatter built into the C# compiler.

Eg: abc{ Replacement1 } outputs the key " Replacement1 ", when it should really be "Replacement1".

Additionally, spaces are currently allowed in the middle of keys, which throws an "Unexpected Token" error in the C# compiler's string interpolation.

Both of these behaviours should eventually be configurable with a user specified setting value.

Items:

  • Write tests
  • Implement whitespace trimming in the tokenizer (Thanks Trim(ReadOnlySpan<Char>)
  • Implement whitespace detection in the key

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions