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

Fix percent string literal with operator #478

Merged
merged 2 commits into from
Aug 8, 2017

Conversation

aycabta
Copy link
Member

@aycabta aycabta commented Aug 3, 2017

For example, %*string* is changed to %Q*string*. It's equivalent string literal to be sure, but this is not good for source code quotation in HTML document.

def example
  a_string = %*string*
  the_same_of_above = %Q*string*
end

The code above is highlighted below:

<pre>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">example</span>
  <span class="ruby-identifier">a_string</span> = <span class="ruby-string">%Q*string*</span>
  <span class="ruby-identifier">the_same_of_above</span> = <span class="ruby-string">%Q*string*</span>
<span class="ruby-keyword">end</span>
</pre>

%string becomes %Qstring

This Pull Request fixes it:

<pre>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">example</span>
  <span class="ruby-identifier">a_string</span> = <span class="ruby-string">%*string*</span>
  <span class="ruby-identifier">the_same_of_above</span> = <span class="ruby-string">%Q*string*</span>
<span class="ruby-keyword">end</span>
</pre>

%string keeps its

It's the same of the original source code.

aycabta added 2 commits August 3, 2017 22:08
For example, %*string* is changed to %Q*string*.
It's equivalent string literal to be sure,
but this is not good for source code in HTML.
This commit fixes it.
@hsbt hsbt self-assigned this Aug 5, 2017
@hsbt
Copy link
Member

hsbt commented Aug 8, 2017

I do not understand why existence behavior happens...

@hsbt hsbt merged commit d3f8522 into ruby:master Aug 8, 2017
@aycabta aycabta deleted the fix-percent-string-literal-with-operator branch August 8, 2017 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants