Skip to content

Glitch on colors #1

@Masum-Osman

Description

@Masum-Osman

Description

Noticed that the PrettyPrint package sometimes has a glitch with the color coding. Specifically, it occasionally breaks the color code for "key" and "value" in the JSON output printed to the terminal.

Steps to Reproduce

Use the PrettyPrint package to print a Go struct as indented JSON in the terminal.
Observe the color output for keys and values.
Expected Behavior
Keys should consistently be colored cyan, and values should be consistently colored yellow.

Actual Behavior

Occasionally, the color coding for keys and values is broken, resulting in incorrect or inconsistent colors.

Additional Information

The issue appears sporadically and is not consistent.
It might be related to the handling of quotes and special characters in the JSON string.
Proposed Solution
Investigate the logic for determining when to apply color coding, especially around quotes and special characters. Ensure that the state (e.g., inString, isKey, insideArray) is correctly managed throughout the process.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions