Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indent multiline strings #10

Merged
merged 1 commit into from
Mar 21, 2014
Merged

indent multiline strings #10

merged 1 commit into from
Mar 21, 2014

Conversation

EndangeredMassa
Copy link
Contributor

If a value is a multiline string, the indentation of the output can look jagged. This PR forces the indentation to be used within multiline strings. It also adds a wrapper to make it more clear that this is happening.

Before this PR:

var obj = {
  message: "something went wrong:\nit didn't start"
};
console.log(render(ojb), {}, 4);

/*
    message: something went wrong:
it didn't start
*/

After this PR:

var obj = {
  message: "something went wrong:\nit didn't start"
};
console.log(render(ojb), {}, 4);

/*
    message: 
      """
        something went wrong:
        it didn't start
      """
*/

I'm open to thoughts on the exact formatting. I could really use this feature in general, though.

rafeca added a commit that referenced this pull request Mar 21, 2014
@rafeca rafeca merged commit e7a634e into rafeca:master Mar 21, 2014
@rafeca
Copy link
Owner

rafeca commented Mar 21, 2014

Awesome contribution! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants