Menu

Highlighting /> shorthand

2007-08-07
2012-11-13
  • Nobody/Anonymous

    Noticed that when you use something like <br/> the /> doesn't get highlighted

     
    • CodeNexus

      CodeNexus - 2007-08-13

      Yep just a visual thing... pity I have no idea on a suggested fix.

       
    • CodeNexus

      CodeNexus - 2007-08-13

      Hang on.... is it just me or does it seem to work in XML???

       
    • CodeNexus

      CodeNexus - 2007-08-15

      Brilliant, simply brilliant...!  Thank you!

      :-D

      I changed it slightly...  I capitalized it and also removed the font name (so it will use your default font.

      <WordsStyle name="CLOSING TAG" styleID="11" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />

       
    • CodeNexus

      CodeNexus - 2007-08-07

      yeah that really should get highlighted....

      I don't know what happens when you do <img src="example.gif" /> or something as well.

       
    • Nobody/Anonymous

      Same thing.  Seems to just not recognize /> at all.  Not a huge program breaking problem, at least.

       
    • CodeNexus

      CodeNexus - 2007-08-14

      So that is interesting XML seems to work ok but not html/php.  I've looked through all the configuration files I can think of looking for how the languages are set up but I can not see any major clues.

       
      • Martijn Coppoolse

        Tag closures like /> _are_ highlighted, but somehow by default that style isn't editable, and it's identical to the default style.

        This can be fixed by editing stylers.xml.

        - Open stylers.xml
        - Look up the <LexerType name="html"...></LexerType>
        - In there, make sure there's a <WordsStyle/> element with styleID="11"; that will contain the style information for tag closures.
        For example: <WordsStyle name="Closing tag" styleID="11" fgColor="0000FF" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="" />
        - Save it.

        It will now appear in the Styler Configuration dialog (but you can set the colours directly in the file as well).

        Note that if you edit it using Notepad++, the file will be in use, so you won't be able to save it. Just save it to a different folder (or another name), exit Notepad++, and swap the files.