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

capitalized "New" in PHP strings causing error #202

Closed
DhatesCode opened this issue Aug 12, 2016 · 0 comments
Closed

capitalized "New" in PHP strings causing error #202

DhatesCode opened this issue Aug 12, 2016 · 0 comments

Comments

@DhatesCode
Copy link

DhatesCode commented Aug 12, 2016

It seems if the word "New" is inside an echo string, it's confusing Rainbow into thinking it's a keyword, and breaking code after it as well (in my case $variables). It happens in data-language="php" and data-language="html" with embedded PHP.

It happens whether the echo string is in single ' ' or double " " quotes. In the name "New York," "New" gets a class of keyword and "York" gets a class of class="support class".

In the examples, the . $meh also loses proper formatting. . $ is floating loose and "meh" becomes class="support class" instead of variable.

Here's a fiddle showing both.

and some code:

<pre><code data-language="php">function someFunction() {

    if ( is_something() ) {
        echo 'something something in New York' . $meh;
    }

}</code></pre>
<pre><code data-language="html">&lt;div&gt;
&lt;?php
function someFunction() {

    if ( is_something() ) {
        echo 'something something in New York' . $meh;
    }
}
?&gt;&lt;/div&gt;</code></pre>
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

No branches or pull requests

1 participant