Highlight Vars in String

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!
Post Reply
User avatar
Capricorn
Posts: 63
Joined: Fri Aug 06, 2010 11:37 am
Location: Germany!
Contact:

Highlight Vars in String

Post by Capricorn »

Like you know you can echo PHP vars in strings with double quote. Example:
Image

If would prefer something like that:
Image

But of coures only if the variable is in a double quote string, because in a single quote string the text is echoed like it is.


Capricorn
User avatar
Capricorn
Posts: 63
Joined: Fri Aug 06, 2010 11:37 am
Location: Germany!
Contact:

Re: Highlight Vars in String

Post by Capricorn »

I just found another problem with the syntax highlighter:
Image
Wrong Highlighter, but the code works perfect. The </script> is no comment, so it should seperate the html and the JS, but the highlighter doesn't do this. That's why the </head> is red/black instead of blue.

If I write the Script-end-tag in a new line it works:
Image
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: Highlight Vars in String

Post by Gatis »

Hello,

Which version are you using? This <script> tag highlighting works fine for me.Can you upload somewhere the file so we can see this for ourselves - maybe there is some other problem with this.
Kind regards,
Gatis Avots
User avatar
Capricorn
Posts: 63
Joined: Fri Aug 06, 2010 11:37 am
Location: Germany!
Contact:

Re: Highlight Vars in String

Post by Capricorn »

You could try this normal XHTML Code:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title></title>
<script> //<![CDATA[
    alert("Hello");
// ]]>></script>
</head>

<body>

</body>

</html>
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: Highlight Vars in String

Post by Gatis »

Hi,

It seems you are right. Thank you for reporting this.
Currently you can use the following code instead:

Code: Select all

<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

/*]]>*/
</script>
You can fix this problem inside the parsers definitions files yourself, if you want this urgently.
I think we will release a fix to this problem with next major release.
Kind regards,
Gatis Avots
User avatar
Capricorn
Posts: 63
Joined: Fri Aug 06, 2010 11:37 am
Location: Germany!
Contact:

Re: Highlight Vars in String

Post by Capricorn »

ok, no problem.
What about my first suggestion?! Will you include it in the next version, too?
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: Highlight Vars in String

Post by Gatis »

Not sure I understood your first question.

Does not the following solution help you (if you want to highlight PHP variables inside strings):
http://forums.blumentals.net/viewtopic. ... ing#p15054
Kind regards,
Gatis Avots
User avatar
Capricorn
Posts: 63
Joined: Fri Aug 06, 2010 11:37 am
Location: Germany!
Contact:

Re: Highlight Vars in String

Post by Capricorn »

Jeah, a little bit. After the mod it looks like that:
Image

But it would be perfect if the variable in the single quoted string is not highlighted as a var because php does not handle it like a variable. Just in double quoted strings.

Capricorn
Post Reply