erb.js 661 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. Language: ERB (Embedded Ruby)
  3. Requires: xml.js, ruby.js
  4. Author: Lucas Mazza <lucastmazza@gmail.com>
  5. Contributors: Kassio Borges <kassioborgesm@gmail.com>
  6. Description: "Bridge" language defining fragments of Ruby in HTML within <% .. %>
  7. Website: https://ruby-doc.org/stdlib-2.6.5/libdoc/erb/rdoc/ERB.html
  8. Category: template
  9. */
  10. /** @type LanguageFn */
  11. function erb(hljs) {
  12. return {
  13. name: 'ERB',
  14. subLanguage: 'xml',
  15. contains: [
  16. hljs.COMMENT('<%#', '%>'),
  17. {
  18. begin: '<%[%=-]?',
  19. end: '[%-]?%>',
  20. subLanguage: 'ruby',
  21. excludeBegin: true,
  22. excludeEnd: true
  23. }
  24. ]
  25. };
  26. }
  27. module.exports = erb;