anchor.diff:  /*  modes.js
   
  -    Add highlighting rules for gollum-specific block level syntax to ACE.
  +    Add highlighting rules for gollum-specific syntax to ACE.
       We first have to extends the Highlighters for each supported syntax,
       so that later, we can extend the relevant ACE Mode to use the custom Highlighter.
  -    We do this for all and only those languages which ACE supports, i.e.,
  -    for which it has a specific Highlighter and Mode. So we do not extend e.g. Creole,
  -    for which there is no ACE Mode (we use the 'text mode' instead).
       At the moment there are two gollum-wide block level syntaxes which need to be added:
   
       * GitHub style code blocks: ``` ... ```
       * UML blocks: @startuml ... @enduml
  +
  +    In addition, there are universal gollum tags:
  +
  +    [[link]]]
   
       The regexes defined for these below should be equivalent to the regexes used by
       gollum-lib to extract these blocks.
  
positive.code:       * Dynamically generating modes: https://stackoverflow.com/questions/22166784/dynamically-update-syntax-highlighting-mode-rules-for-the-ace-editor
  */
  
  
  <%
  uml_rule_name = 'UMLBlock'
  
negative.code: 
  (function($) {
    var AceMode = {
      asciidoc: {
        mode: 'asciidoc',
        highlighter: 'GollumAsciidocHighlightRules'
      },
      creole: {
        mode: 'text',
        highlighter: 'GollumTextHighlightRules'
      },
      markdown: {
        mode: 'markdown',
        highlighter: 'GollumMarkdownHighlightRules'
      },
      mediawiki: {
        mode: 'text',
        highlighter: 'GollumTextHighlightRules'
      },
      bib: {
        mode: 'latex'
      },
      org: {
        mode: 'text',
        highlighter: 'GollumTextHighlightRules'
      },
      rst: {
        mode: 'rst',
        highlighter: 'GollumRstHighlightRules'
      },
      txt: {
        mode: 'text'
      },
      pod: {
        mode: 'text',
        highlighter: 'GollumTextHighlightRules'
      },
      rdoc: {
        mode: 'rdoc',
        highlighter: 'GollumRdocHighlightRules'
      },
      textile: {
        mode: 'textile',
        highlighter: 'GollumTextileHighlightRules'
      }
    };
  
    $.getEditorMode = function ( mode ) {
      var lang = null;
      if (lang = AceMode[mode]) {
        var ace_mode = lang['mode'];
        var gollum_rules = lang['highlighter'];
        if (gollum_rules){ // We have extended highlighters
          var baseMode = ace.require("ace/mode/" + ace_mode).Mode;
          var dynamicMode = new baseMode();
          dynamicMode.HighlightRules = ace.require(gollum_rules).GollumHighlightRules;
          return dynamicMode;      
        } else {
          return "ace/mode/" + ace_mode;
  