/ src / theme / languages / erb.js
erb.js
 1  /*! `erb` grammar compiled for Highlight.js 11.10.0 */
 2    (function(){
 3      var hljsGrammar = (function () {
 4    'use strict';
 5  
 6    /*
 7    Language: ERB (Embedded Ruby)
 8    Requires: xml.js, ruby.js
 9    Author: Lucas Mazza <lucastmazza@gmail.com>
10    Contributors: Kassio Borges <kassioborgesm@gmail.com>
11    Description: "Bridge" language defining fragments of Ruby in HTML within <% .. %>
12    Website: https://ruby-doc.org/stdlib-2.6.5/libdoc/erb/rdoc/ERB.html
13    Category: template
14    */
15  
16    /** @type LanguageFn */
17    function erb(hljs) {
18      return {
19        name: 'ERB',
20        subLanguage: 'xml',
21        contains: [
22          hljs.COMMENT('<%#', '%>'),
23          {
24            begin: '<%[%=-]?',
25            end: '[%-]?%>',
26            subLanguage: 'ruby',
27            excludeBegin: true,
28            excludeEnd: true
29          }
30        ]
31      };
32    }
33  
34    return erb;
35  
36  })();
37  
38      hljs.registerLanguage('erb', hljsGrammar);
39    })();