Skip to content

Bug on parse empty color text #12

@chemzqm

Description

@chemzqm

Consider parse the text: \u001b[33m\u001b[mText.

It would be:

{
      foreground: 'yellow', text: 'Text'
}

but it sould be:

{ text: 'Text' }

The code need a bit change:

        if (matchingText != null) {
          state.text = matchingText
          if (matchingText) {
            result.push(state)
          }
          state = {}
          matchingText = ''
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions