[SVN] HTML highlighting in PHP strings

Mats Persson mats at imediatec.co.uk
Mon May 2 11:02:59 UTC 2005


On 2 May 2005, at 00:54, Max Williams wrote:
> Most strings in php are going to become html when printed, so why  
> do they lack syntax highlighting as php strings?

Hmm, Max, interesting point, but can I ask you for a clarification ?  
Which one are you talking about:

1.     basic simple html tags within php strings:
         <?php  echo "<p>paragraph tags within a php string</p>";  ?>

2.    more complex html within php strings (along these simplified  
lines):
         <?php
             $html = "<div id=\"$idName\">";
             $html .= "<h1>$HeaderTxt</h1>";
             $html .= "</div>";
             echo $html;
         ?>

If we are dealing with v1 then it should be fairly simple to handle  
it in the syntax.  If you are talking about v2, then I would suggest  
the normal php in/out formatting, something like this, which is well  
handled at the moment:

<div id="<?php echo $idName; ?>">
     <h1><?php echo $HeaderTxt; ?></h1>
</div>


> Another idea I had would be to include source.css property-list  
> into the value part of the html 'style' attribute, to make that  
> colourized.

Yes to this one, within limitations, although it is NOT good practice  
to embed the styles within the html style attribute. (I know, there  
occasions when it works better or is needed)


> Maybe these are rather gimmicky proposals, but Textmate seems to  
> have the potential to do this kind of thing, and I think it would  
> be useful. I'd be interested to hear what other people think.

I think TM 1.1b8 will have (?) a Content node within it, so we could  
handle things like this easier, faster and better.


Kind regards,

Mats

----
"TextMate, coding with an incredible sense of joy and ease"
- www.macromates.com -





More information about the textmate-dev mailing list