ERB rendering is too greedy with comments
Summary
When eruby code is rendered, then comments seem to match the largest possible area instead of only the tags in which they're contained.
Steps to reproduce
Here's an example of the bug:
{
"name": "<%= project[:name] %>",
"version": "0.0.0",
"author": "someone",
"summary": "<%= project[:description] %>",
<%# Puppet ignores modules with null licenses -%>
"license": "TBD",
"source": "<%= "#{project[:web_url]}/tree/production" %>",
"project_page": "<%= project[:web_url] %>",
"issues_url": <%= if project[:issues_enabled] then "\"#{project[:web_url]}/issues\"" else "null" end %>,
"dependencies": [
{ "name": "puppetlabs-stdlib", "version_requirement": ">= 1.0.0" }
],
"data_provider": null
}
Expected behavior
The commented text should stay inside the erb tag where it's placed.
Actual behavior
The commented text visibly extends all the way to the final end tag.
Decided to skip the checks since it's verifiable on GitLab.com