index.js
function postProcess(state) {
    var i,
        foundStart = false,
        foundEnd = false,
        delim,
        token,
        delimiters = state.delimiters,
        max = state.delimiters.length;

    for (i = 0; i < max; i++) {
      delim = delimiters[i];
      if (delim.marker === '->') {
        foundStart = true;
      } else if (delim.marker === '<-') {
        foundEnd = true;
      }
    }
    if (foundStart && foundEnd) {
      for (i = 0; i < max; i++) {
        delim = delimiters[i];

        if (delim.marker === '->') {
          foundStart = true;
          token         = state.tokens[delim.token];
          token.type    = 'centertext_open';
          token.tag     = 'div';
          token.nesting = 1;
          token.markup  = '->';
          token.content = '';
          token.attrs = [ [ 'class', 'text-align-center' ] ];
        } else if (delim.marker === '<-') {
          if (foundStart) {
            token         = state.tokens[delim.token];
            token.type    = 'centertext_close';
            token.tag     = 'div';
            token.nesting = -1;
            token.markup  = '<-';
            token.content = '';
          }
        }
      }
    }
  }
function postProcess(state) {
    var i,
        foundStart = false,
        foundEnd = false,
        delim,
        token,
        delimiters = state.delimiters,
        max = state.delimiters.length;

    for (i = 0; i < max; i++) {
      delim = delimiters[i];
      if (delim.marker === '->') {
        foundStart = true;
      } else if (delim.marker === '<-') {
        foundEnd = true;
      }
    }
    if (foundStart && foundEnd) {
      for (i = 0; i < max; i++) {
        delim = delimiters[i];

        if (delim.marker === '->') {
          foundStart = true;
          token         = state.tokens[delim.token];
          token.type    = 'centertext_open';
          token.tag     = 'div';
          token.nesting = 1;
          token.markup  = '->';
          token.content = '';
          token.attrs = [ [ 'class', 'text-align-center' ] ];
        } else if (delim.marker === '<-') {
          if (foundStart) {
            token         = state.tokens[delim.token];
            token.type    = 'centertext_close';
            token.tag     = 'div';
            token.nesting = -1;
            token.markup  = '<-';
            token.content = '';
          }
        }
      }
    }
  }
function postProcess ( state ) { var i , foundStart = false , foundEnd = false , delim , token , delimiters = state . delimiters , max = state . delimiters . length ; for ( i = 0 ; i < max ; i ++ ) { delim = delimiters [ i ] ; if ( delim . marker === '->' ) { foundStart = true ; } else if ( delim . marker === '<-' ) { foundEnd = true ; } } if ( foundStart && foundEnd ) { for ( i = 0 ; i < max ; i ++ ) { delim = delimiters [ i ] ; if ( delim . marker === '->' ) { foundStart = true ; token = state . tokens [ delim . token ] ; token . type = 'centertext_open' ; token . tag = 'div' ; token . nesting = 1 ; token . markup = '->' ; token . content = '' ; token . attrs = [ [ 'class' , 'text-align-center' ] ] ; } else if ( delim . marker === '<-' ) { if ( foundStart ) { token = state . tokens [ delim . token ] ; token . type = 'centertext_close' ; token . tag = 'div' ; token . nesting = - 1 ; token . markup = '<-' ; token . content = '' ; } } } } }
Walk through delimiter list and replace text tokens with tags
Walk through delimiter list and replace text tokens with tags