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

Keep trailing spaces on comments #598

Closed
sitegui opened this issue Dec 26, 2014 · 2 comments
Closed

Keep trailing spaces on comments #598

sitegui opened this issue Dec 26, 2014 · 2 comments
Milestone

Comments

@sitegui
Copy link

sitegui commented Dec 26, 2014

Hello,

I've noticed that trailing spaces on comments are stripped in some cases. Some examples that keep them:

// A line comment  
var a = 2
/*
A multiline with no star  
*/
var a = 2

But this one does not:

/*
* A multiline with star  
*/
var a = 2

(Tested on web)

For my use case, this is bad because js-docs comments are processed as Markdown, and two trailing spaces is the markdown way to print a new line in the final rendering.

This seems like a bug, since some formats do keep the trailing space, but I would like some confirmation on that.

Happy Holidays,
Gui

@bitwiseman bitwiseman added this to the v1.5.5 milestone Jan 29, 2015
@bitwiseman
Copy link
Member

Interesting. Shouldn't be hard to fix.

websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 6, 2015
websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 6, 2015
@bitwiseman
Copy link
Member

https://github.com/beautify-web/js-beautify/blob/master/js/lib/beautify.js#L1157
If we change that trim to ltrim, I think that would do it.

websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 10, 2015
websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 10, 2015
websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 10, 2015
websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 10, 2015
websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 10, 2015
websiddu added a commit to websiddu/js-beautify that referenced this issue Feb 10, 2015
bitwiseman added a commit that referenced this issue Feb 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants