Skip to content

"sometext\"sometext" is beutified to 'sometext"sometext' #3

Description

@paponius

A data in single quotes then fails as valid JSON.

I guess JSON is passed to uglifyjs as JS and there it's understood as a variable (Array/Object)
where '"' is valid, but not in JSON.

There is an old discussion:
mishoo/UglifyJS#156
Seems like there is no interest in adding the support. But it's old and now I see:

-p, --parse <options>       ...
          `expression`  Parse a single expression, rather than
                    a program (for parsing JSON).
          `spidermonkey`  Assume input files are SpiderMonkey
                   AST format (as JSON).

but I didn't look further.

The thing is, that the standard JSON.stringify works really good.
JSON.stringify(Sites, null, "\t")
outputs a nice beautified JSON.

Would you thing about adding an option to minjson and subsequently to Sublime Editor to use JSON instead of UglifyJS for minjson?
Thanks

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions