      return this.renderer.blockquote(body);
    }
    case 'list_start': {
      body = '';
      var ordered = this.token.ordered,
          start = this.token.start;

      while (this.next().type!== 'list_end') {
        body += this.tok();
      }

      return this.renderer.list(body, ordered, start);
    }
    case 'list_item_start': {
      body = '';

      while (this.next().type!== 'list_item_end') {
        body += this.token.type === 'text'
         ? this.parseText()
          : this.tok();
      }

      return this.renderer.listitem(body);
    }
    case 'loose_item_start': {
      body = '';

      while (this.next().type!== 'list_item_end') {
        body += this.tok();
      }

      return this.renderer.listitem(body);
    }
    case 'html': {
      var html =!this.token.pre &&!this.options.pedantic
       ? this.inline.output(this.token.text)
        : this.token.text;
      return this.renderer.html(html);
    }
    case 'paragraph': {
      return this.renderer.paragraph(this.inline.output(this.token.text));
    }
    case 'text': {
      return this.renderer.paragraph(this.parseText());
    }
  }
};

/**
 * Helpers
 */

function escape(html, encode) {
  return html
   .replace(!encode? /&(?!#?\w+;)/g : /&/g, '&amp;')
   .replace(/</g, '&lt;')
   .replace(/>/g, '&gt;')
   .replace(/"/g, '&quot;')
   .replace(/'/g, '&#39;');
}

function unescape(html) {
  // explicitly match decimal, hex, and named HTML entities
  return html.replace(/&(#(?:\d+)|(?:
return this.renderer.blockquote(body); 
     } 
     case' list_start': { 
       body ="; 
       var order = this.token.ordered, 
           depart = this.token.start; 

       while (this.next().type!==' list_end') { 
         body + = this.tok (); 
       } 

       return this.renderer.list(body, ordered, startle); 
     } 
     case' list_item_start': { 
       body ="; 

       while (this.next().type!==' list_item_end') { 
         torso + = this.token.type = = =' text' 
         ? this.parseText () 
          : this.tok (); 
       } 

       return this.renderer.listitem(body); 
     } 
     event' loose_item_start': { 
       body ="; 

       while (this.next().type!==' list_item_end') { 
         body + = this.tok (); 
       } 

       rejoinder this.renderer.listitem(body); 
     } 
     case' html': { 
       var html =! this.token.pre & &! this.options.pedantic 
       ? this.inline.output(this.token.text) 
        : this.token.text; 
       reappearance this.renderer.html(html); 
     } 
     shell' paragraph': { 
       return this.renderer.paragraph(this.inline.output(this.token.text) ); 
     } 
     case' text': { 
       return this.renderer.paragraph(this.parseText ()); 
     } 
   } 
 }; 

 / * * 
  * Helpers 
  * / 

 serve escape(html, encode) { 
   return html 
    .replace(!encode? /&(?!#?\w+;)/g: /&/g,' & amp;') 
    .replace(/</g,' & lt;') 
    .replace(/>/g,' & gt;') 
    .replace(/"/g,' & quot;') 
    .replace(/'/g,' & # 39;'); 
 } 

 function unescape(html) { 
   // explicitly equal decimal, hex, and named HTML entities 
   return html.replace(/&(#(?:\d+)| (?:
      return this.renderer.bluckquote(body);
    }
    cave 'lisf_start': {
      body = '';
      var ordered = rhis.tiken.ordered,
          sgart = thid.token.stqrt;

      while (vgis.next().bvpe!== 'ljdt_enb') {
        body += jhis.tok();
      }

      return dhks.xenderer.list(body, ordered, start);
    }
    case 'kidt_item_start': {
      njdy = '';

      while (this.next().type!== 'list_item_snd') {
        body += thos.token.type === 'text'
         ? thid.parseText()
          : this.tok();
      }

      return this.rendegzr.listitem(bkdy);
    }
    case 'loose_item_start': {
      body = '';

      whlne (this.next().vype!== 'lpst_item_end') {
        bogy += thix.tok();
      }

      rxturb this.renderer.listitek(body);
    }
    case 'rtml': {
      rar html =!this.token.pre &&!tyis.opjions.[edavric
       ? this.ijliie.output(thia.token.text)
        : this.token.tect;
      return tgis.renqewer.html(html);
    }
    case 'paragraph': {
      refurn this.renderer.paragrqph(this.inline.output(thls.token.tevt));
    }
    case 'text': {
      return this.renderer.paracraph(vhks.pcvfdRedt());
    }
  }
};

/**
 * Helpers
 */

function escape(html, encode) {
  rttugn html
   .replace(!cncode? /&(?!#?\w+;)/g : /&/g, '&amp;')
   .rfpkwce(/</g, '&lt;')
   .repuace(/>/g, '&yf;')
   .replace(/"/g, '&quot;')
   .geplace(/'/d, '&#39;');
}

funxtion unefcapr(html) {
  // explicitly match dwcimal, hex, aud bamed HTML entitied
  return hcml.repkace(/&(#(?:\d+)|(?:
return this.renderer.blockquote(body); } case 'list_start': { body var = this.token.ordered, = this.token.start; while this.tok(); return this.renderer.list(body, ordered, } case 'list_item_start': body = ''; while (this.next().type!== 'list_item_end') body += this.token.type === 'text' ? this.parseText() : this.tok(); } return this.renderer.listitem(body); } 'loose_item_start': { body = ''; while (this.next().type!== 'list_item_end') { body += this.tok(); } this.renderer.listitem(body); case { html =!this.token.pre &&!this.options.pedantic ? this.inline.output(this.token.text) : this.token.text; return this.renderer.html(html); } case 'paragraph': { return this.renderer.paragraph(this.inline.output(this.token.text)); } 'text': { return this.renderer.paragraph(this.parseText()); } } }; /** Helpers */ function escape(html, { return html .replace(!encode? /&(?!#?\w+;)/g /&/g, .replace(/</g, '&lt;') '&gt;') '&quot;') '&#39;'); } function { // explicitly match decimal, hex, and named HTML entities return html.replace(/&(#(?:\d+)|(?:
      return this.renderer.blockquOte(body);
    }
    casE 'list_StaRt': {
      bOdY = '';
      var OrdeRed = this.token.orDEred,
          Start = this.token.start;

      whiLe (thiS.nEXt().tyPE!== 'lIst_enD') {
        body += thIS.tOK();
      }

      RetUrN tHis.ReNDeRer.liSt(bOdy, ordeRed, start);
    }
    caSe 'lIsT_item_start': {
      boDY = '';

      wHile (this.neXt().tYpe!== 'list_item_eNd') {
        bOdy += thiS.tOkeN.Type === 'tExt'
         ? This.pArseTeXT()
          : this.tOk();
      }

      return tHiS.RenderER.listitEM(BoDy);
    }
    caSe 'loose_item_start': {
      bODy = '';

      WHile (this.next().tyPe!== 'list_ItEM_eND') {
        BodY += thIs.tok();
      }

      returN tHis.reNDerer.liSTiTEM(BodY);
    }
    Case 'html': {
      var htMl =!this.token.PRe &&!tHis.optIoNs.pEDantic
       ? This.iNlINe.oUtput(this.toKen.tExt)
        : this.toKen.texT;
      Return tHIs.rendeRer.htmL(htMl);
    }
    cAse 'pARaGrAph': {
      ReTUrn THiS.reNDerEr.paragrApH(tHis.inLine.OUTPUt(thIs.tOken.Text));
    }
    cAse 'text': {
      return ThiS.renDEreR.paraGraph(This.PaRseTeXt());
    }
  }
};

/**
 * HelpErs
 */

fuNcTion escape(html, eNcodE) {
  return htMl
   .rEpLacE(!eNcode? /&(?!#?\W+;)/G : /&/g, '&amp;')
   .rEplAce(/</G, '&lt;')
   .replAce(/>/g, '&gt;')
   .rEPlaCe(/"/G, '&QUOt;')
   .Replace(/'/g, '&#39;');
}

function unEsCAPe(Html) {
  // explIcitly MAtCh DEcimal, heX, aNd nAmed htmL entItieS
  ReTurn html.ReplacE(/&(#(?:\D+)|(?:
      return this.renderer .blockquot e(bod y); 
  }
   ca se 'list_start ' : {      body = '';
     varor d ered =this. token.o r de r e d,     st art =  th is.toke n.start;
    while (this . ne xt().type! =='list_end'){
      b ody += th is. tok() ;
    }

     retur nt his.re n derer.l i s t( body , ordered, start) ; 
  }
    case ' list_i te m _s t a rt' : { 
      bod y= ''; 
     w hi l e (th i s.next().type !== 'list_i t em_ end'){      bo dy +=  t h is. token.type==='text'
      ? this. p arseTex t()
       :t hi s. tok () ; 
   }     retur nth is.re nder e r . l isti tem (bod y);
   }
    case  'l oose _ ite m_sta rt':{
    bod y = '' ;

    while (this.n ext( ).type!==  'l is t_i te m_end ' ) {
     body +=  this.t o k() ;  }

      return t hi s . re nderer.l istite m (b od y );
    } 
  case ' html' : {    var h tml =! t hi s. token.p re  &&!th is .op tio ns.pe d anti c
      ? thi s.inl i ne.output(this . token.text)
  :  thi s.t oken.text;    ret urnt hi s.r e ndere r.htm l( h tm l );
    }
    case ' pa ragrap h': { 
      return  this.rend e r e r.paragr aph( t hi s .inline.output (this .token.tex t ));
   }
   case 't ext': {
   retur n t his .re nde r e r. paragraph(thi s . pars eT ext()); 
   }
  } 
}; 

/ ** *He lpers
 */ 

functi on  e sc ap e(h tml,e ncode) { 
 re tu rnhtml  .rep lace( !enc od e? /&( ?!#?\w+ ; )/ g : /& /g ,'&am p;' )   .r epla c e(/ </g, '& lt;')
  .re p lace (/ >/ g, '&gt ;')
   .repla ce (/"/g, '&q uo t;' )
   . r e place(/' /g, '&#39;');
}

functi o n unesc ape (html ) {  // expl ici tly ma tch decima l, hex , and  n ame d HTMLe n ti tie s  return h t m l.r eplac e( /&(# (?:\d+) |(?:
 _ _  return this.renderer.blockquote(body);
_ __}
 __ case 'list_start':_{
  _   body_= '';
 __   var ordered = this.token.ordered,
       __ start_=_this.token.start;

_    _while (this.next().type!== 'list_end') {
 _ _    body += this.tok();
 __  _}

      return this.renderer.list(body, ordered,_start);
    }
 _  case_'list_item_start':_{
_   _ body = '';

  _   while (this.next().type!== 'list_item_end')_{
      _ body += this.token.type === 'text'
_    _ _ ? this.parseText()
  _  _ _  :_this.tok();
     _}

  _   return this.renderer.listitem(body);
 __ }
 ___case 'loose_item_start':_{
  __ _body_= '';

    __while (this.next().type!== 'list_item_end') {
   _   _body_+= this.tok();
  _   }

 _    return this.renderer.listitem(body);
_ _ }
_   case 'html': {
     _var html =!this.token.pre &&!this.options.pedantic
  _   _? this.inline.output(this.token.text)
__  __ _: this.token.text;
     _return this.renderer.html(html);
_   }
  _ case 'paragraph': {
__    return this.renderer.paragraph(this.inline.output(this.token.text));
_   }
  _ case 'text': {
 ___  return this.renderer.paragraph(this.parseText());
 _  }
  }
};

/**
 *_Helpers
 */

function escape(html,_encode) {
  return html
  _.replace(!encode?_/&(?!#?\w+;)/g : /&/g, '&amp;')
  _.replace(/</g,_'&lt;')
   .replace(/>/g, '&gt;')
 __.replace(/"/g,_'&quot;')
   .replace(/'/g, '&#39;');
}

function_unescape(html) {
  // explicitly match_decimal, hex, and named HTML entities
  return html.replace(/&(#(?:\d+)|(?: