Menu

CSS syntax highlighting in HTML files

2011-05-31
2012-11-13
  • Maximus Saint

    Maximus Saint - 2011-05-31


    …quite disappointing situation.
    we all have to work with user styles, and sometimes they are quite big.

    how can i include CSS syntax highlighting in my HTML (php) files?

     
  • cchris

    cchris - 2011-05-31

    Scintilla has had nested lexers on its todo list for a while, to solve issues like this.

    CChris

     
  • Maximus Saint

    Maximus Saint - 2011-05-31

    thank you for response Chris,
    too bad nobody has solved this problem yet :(

     
  • bbluemel

    bbluemel - 2011-05-31

    My ColdFusion Plugin does a bit more highlighting than the default notepad++ html one (handles html files fine, just do Language - ColdFusion):

    Although most CSS should really be in a css file rather than embedded :)

     
  • Maximus Saint

    Maximus Saint - 2011-06-01

    good idea bbluemel , thanks.

    Although most CSS should really be in a css file rather than embedded

    yeah, well… web isn't perfect :))

     
  • Maximus Saint

    Maximus Saint - 2011-06-04

    noticed the same thing with HTML inside PHP files…. this is totally unacceptable.
    how come developers haven't fixed this right from the start?!
    this problem makes me want to go back to windows notepad…. facepalm!

     
  • Troy

    Troy - 2011-08-14

    I guess I must be just missing something, but how is syntax highlighting CSS within HTML files (which it doesn't do) any different from highlighting javascript with HTML files (which is does do and has done for years)?

     
  • Mike Cowperthwaite

    The difference is, the HTML lexer is written with built-in support for JavaScript. (If you open a .JS file, it's still the HTML lexer that gets loaded; there is no separate JS lexer.) The HTML lexer needs to be rewritten, probably with a separate JS lexer and proper lexer nesting for JS and CSS; and maybe that'll get done at Scintilla one of these years. Don't expect it to appear in Notepad++ before it gets done in Scintilla.

     
  • Troy

    Troy - 2011-08-19

    Thank you! 
    That makes total sense - I've been wondering about that for way too long…
    Much appreciated :-)

     
MongoDB Logo MongoDB