How can I make some xml-tags activate different language highligting?


#1

I’d like to call different language-highligting-modes just as in mixed mode. The origin is always xml (with some quirks) and highlighters that should be requested upon match are php, javascript, css, html and of course xml itself.

I look at modes / simple modes but can’t find a good starting point. Most thankful for any advices.

#1. Commenting, using #, should also be allowed before xml
# or actually "xml_fa" since xml-rules are being bent...
<xml_fa>
#2. Row breaks (seems to work OOTB)
  <content type="html5/dialog" sql="select * from tbl_tennants where \
TennantID=$somevalue">
  	<formpart>
#3. Custompost-tag should invoke php mode
      <custompost>
switch($action) {
case 'update':
  	$this->f->dbUpdate();
   	break;
}
      </custompost>
      <test />
#4. Raw-tag could be of type css, html, js/javascript and should invoke corr mode
      <raw type="js">
        alert('js running');
      </raw>
    </formpart>
  </content>
</xml_fa>

#2

The scriptTypes option to the htmlmixed mode might be helpful. See this page.


#3

Thanks Marijn, I'm trying to follow the documentation but don't see how I can trigger on other than <script XX>. CSS for example, by default triggers on <style>, not <script>. For example, how would <custompost> (without any args) trigger php? Best regards, /TJ


#4

Oh, the docs were outdated and only showed the old way of configuring. Take a look at the htmlmixed mode again, I’ve updated the docs to describe the more flexible tags option.


#5

Sorry, but I fail to find any documentation regarding *tags* . Hate to tell you but I know nothing about mustashe. Merry christmas by the way, (if you're into that)

Ahhh, lost in browser cache. Thanks!