Hi,
In my application, I often need to obtain the current HTML tag, that is, the tag the cursor is currently within. I'm doing this the "SyntaxEditor way", by obtaining a TokenStream and looping through it to find the beging and the end of the tag. This works fine, as long as it's actually HTML. However, I will need to do this with HTML tags within PHP code as well, like this:I could of course do some regular parsing, but I thought it would be easier to add some states and stuff to the PHP.xml file. I have added the StartTagState and EndTagState from HTML.xml to the file, and configured both DoubleQuoteStringState and SingleQuoteStringState to allow these as childstates. This works surprisingly well, except for one thing: The editor no longer recognizes escaping within the string if it's inside an HTML tag. In the example above, the > of the <a> tag will not be highlighted as a part of the tag. If I remove the two \ characters, it works fine, but of course the PHP code won't work, since the " characters needs to be escaped :). I might be missing something obvious here, but I'm hoping that you can help me make this work.
In my application, I often need to obtain the current HTML tag, that is, the tag the cursor is currently within. I'm doing this the "SyntaxEditor way", by obtaining a TokenStream and looping through it to find the beging and the end of the tag. This works fine, as long as it's actually HTML. However, I will need to do this with HTML tags within PHP code as well, like this:
<?
echo "<a href=\"http://www.actiprosoftware.com\">Test</a>";
?>