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

Do not add newlines when annotating rendered views #40346

Merged
merged 1 commit into from Oct 7, 2020
Merged

Do not add newlines when annotating rendered views #40346

merged 1 commit into from Oct 7, 2020

Conversation

joelhawksley
Copy link
Contributor

When rendering a view with annotate_rendered_view_with_filenames
enabled, we were inserting newlines after the BEGIN and END
comments. These newlines are not ideal in some use cases, such
as rendering templates to strings that are then passed around
our application.

As the newlines were added for aesthetic purposes, we think it
makes sense to remove them so that rendered template strings do
not contain extraneous newlines.

As a result of removing these newlines, the annotations
no longer affect the reporting of template errors on the correct
line, as addressed in #38950. As such, we've reverted those
changes as well.

Co-authored-by: Chris Gavin chrisgavin@github.com

cc @rafaelfranca as the merger of #38950 and @tenderlove as my co-conspirator on annotate_rendered_view_with_filenames.

When rendering a view with annotate_rendered_view_with_filenames
enabled, we were inserting newlines after the BEGIN and END
comments. These newlines are not ideal in some use cases, such
as rendering templates to strings that are then passed around
our application.

As the newlines were added for aesthetic purposes, we think it
makes sense to remove them so that rendered template strings do
not contain extraneous newlines.

As a result of removing these newlines, the annotations
no longer affect the reporting of template error on the correct
line, as addressed in #38950. As such, we've reverted those
changes as well.

Co-authored-by: Chris Gavin <chrisgavin@github.com>
@rails-bot rails-bot bot added the actionview label Oct 6, 2020
@rafaelfranca rafaelfranca merged commit ee247c8 into rails:master Oct 7, 2020
@joelhawksley joelhawksley deleted the annotations-whitespace branch October 7, 2020 13:32
@arthurnn
Copy link
Member

🚀 🥇

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

Successfully merging this pull request may close these issues.

None yet

3 participants