Community
    • Login

    multiple (highlight) languages in one file ((PHP +) HTML + CSS + JS)

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Pete WrightP
      Pete Wright
      last edited by

      Hello Everybody!

      As the topic title says, is there a way to select multiple languages of a file like a web page containing PHP, HTML, CSS and JavaScript.

      If I choose PHP or HTML as language, the job is almost done, since these styles include JavaScript highlighting.

      The problem here is the CSS, which is not highlighted at all.

      So there are two methods I am thinking of:

      1. a) competely create a new user defined language (UDL) from scratch --> the hard way
      2. b) hope that someone already did this before and download his/her style --> the easy way
      3. somehow include CSS as a “sub-language” into PHP or HTML - no idea if this is possible or how to do that if it is

      Does anybody have a solution?
      Many thanks in advance.

      Claudia FrankC 1 Reply Last reply Reply Quote 1
      • Claudia FrankC
        Claudia Frank @Pete Wright
        last edited by

        @Pete-Wright

        creating an UDL lexer for HTML, PHP, CSS and JavaScript is nearly impossible
        as you can’t specify when a new lexer needs to jump in.

        The lexer can be modified to support another lexer as seen
        in the code itself.

        I have no idea how complicated, in terms of lexing, css is, but in theory we could
        use python script plugin and indicators to do this.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors