Menu

Customizing a built-in language: HTML

Exaskryz
2015-01-29
2015-01-30
  • Exaskryz

    Exaskryz - 2015-01-29

    I'm formatting some parts of my .html site with some javascript arrays. I wanted to look at highlighting errors that break the syntax "__":{"":""}, where ___ is about anything. (Alternatively highlight any line that matches that syntax). So two questions:

    1) How do I import the default HTML langauge into a User Defined Language so I can tweak it? I'd like to preserve the normal HTML language in case I screw up somewhere.

    2) Is what I'm looking for syntax highlighting even possible to do?

     
  • Loreia2

    Loreia2 - 2015-01-29

    Hi Exaskryz ,

    this is not possible.

    Best regards,
    Loreia

     

    Last edit: Loreia2 2015-01-29
  • Exaskryz

    Exaskryz - 2015-01-29

    Why isn't it? And which part isn't possible?

    There's no one who has ever managed to code the language for HTML, despite it being built into Notepad++? Not a single dev ever thought to maybe open source that bit as a separate download so you could import it as a custom language?

    Are there any better text editors that do offer the ability to personalize a built in language? I've heard of SCiTE. Might be worth to switch over to a more flexible editor. The only thing that would prevent me from switching is the "Post-It" mode, but I can brute force that functionality out with autohotkey if I wanted to I suppose.

     
  • Loreia2

    Loreia2 - 2015-01-30

    Hi Exaskryz ,

    Why isn't it? And which part isn't possible?

    Well, everything. You can't customize built-in languages by changing configuration files. To achieve that you would have to change the source code.

    There's no one who has ever managed to code the language for HTML, despite it being built into Notepad++? Not a single dev ever thought to maybe open source that bit as a separate download so you could import it as a custom language?

    This is an open source project and patches are always welcome.
    Get the code here: http://svn.tuxfamily.org/viewvc.cgi/notepadplus_repository/trunk/
    HTML lexer is here: http://svn.tuxfamily.org/viewvc.cgi/notepadplus_repository/trunk/scintilla/lexers/LexHTML.cxx?revision=1104&view=markup

    Are there any better text editors that do offer the ability to personalize a built in language? I've heard of SCiTE. Might be worth to switch over to a more flexible editor. The only thing that would prevent me from switching is the "Post-It" mode, but I can brute force that functionality out with autohotkey if I wanted to I suppose.

    SCITE is build around the same lexing component (Scintilla), so it shares the same limitations. I wouldn't know any other tool to recommend.

    Best regards
    Loreia

     
MongoDB Logo MongoDB