scripts/code-viewer.js
function (type) {
      if (!codeViewer.codeActive) {
        return;
      }

      let fill = '';
      codeViewer.tabActive = type;

      $sgCodeTitles.removeClass('sg-code-title-active');

      switch (type) {
        case 'e':
          fill = codeViewer.encoded;

          $sgCodeTitleHtml.addClass('sg-code-title-active');

          break;

        case 'm':
          fill = codeViewer.mustache;

          $sgCodeTitleMustache.addClass('sg-code-title-active');

          break;
      }

      $sgCodeFill.removeClass().addClass('language-markup');
      $sgCodeFill.html(fill);
      window.Prism.highlightElement($sgCodeFill[0]);
      codeViewer.clearSelection();
    }
function (type) {
      if (!codeViewer.codeActive) {
        return;
      }

      let fill = '';
      codeViewer.tabActive = type;

      $sgCodeTitles.removeClass('sg-code-title-active');

      switch (type) {
        case 'e':
          fill = codeViewer.encoded;

          $sgCodeTitleHtml.addClass('sg-code-title-active');

          break;

        case 'm':
          fill = codeViewer.mustache;

          $sgCodeTitleMustache.addClass('sg-code-title-active');

          break;
      }

      $sgCodeFill.removeClass().addClass('language-markup');
      $sgCodeFill.html(fill);
      window.Prism.highlightElement($sgCodeFill[0]);
      codeViewer.clearSelection();
    }
function ( type ) { if ( ! codeViewer . codeActive ) { return ; } let fill = '' ; codeViewer . tabActive = type ; $sgCodeTitles . removeClass ( 'sg-code-title-active' ) ; switch ( type ) { case 'e' : fill = codeViewer . encoded ; $sgCodeTitleHtml . addClass ( 'sg-code-title-active' ) ; break ; case 'm' : fill = codeViewer . mustache ; $sgCodeTitleMustache . addClass ( 'sg-code-title-active' ) ; break ; } $sgCodeFill . removeClass ( ) . addClass ( 'language-markup' ) ; $sgCodeFill . html ( fill ) ; window . Prism . highlightElement ( $sgCodeFill [ 0 ] ) ; codeViewer . clearSelection ( ) ; }
Depending on what tab is clicked this swaps out the code container. Makes sure prism highlight is added.

@param {string} type - Single letter abbreviation of type.
Depending on what tab is clicked this swaps out the code container . Makes sure prism highlight is added .