Posted 15 years ago
by Joachim Schwieren
Hi,
I use a Dynamic Syntax Language to highlight HTML/XML code. I have defined a special state to highlight color names in tag attributes, e.g. <font color="red" id="myid">. So the word "red" is highlighted in another color than the other attributes like "myid" in this example.
Here is how I defined the color names as an ExplicitPatternGroup:This works fine so far but if I have the following HTML code in the Syntax Editor:
The word "Silver" in "SilverlightPlugin1" is also highlighted as color. How can I tell my language definition to only treat this as ColorNameTokenW3C when it is not inside another word?
Thanks for your help!
Joe
[Modified at 01/29/2010 04:39 AM]
I use a Dynamic Syntax Language to highlight HTML/XML code. I have defined a special state to highlight color names in tag attributes, e.g. <font color="red" id="myid">. So the word "red" is highlighted in another color than the other attributes like "myid" in this example.
Here is how I defined the color names as an ExplicitPatternGroup:
<PatternGroups>
<ExplicitPatternGroup TokenKey="ColorNameTokenW3C" TokenID="100">
<ExplicitPatterns>
aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal white yellow
</ExplicitPatterns>
</ExplicitPatternGroup>
<object id="SilverlightPlugin1" width="300" height="300"
data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" >
Thanks for your help!
Joe
[Modified at 01/29/2010 04:39 AM]