index.js
function replaceRenderer(md, renderer) {
  var openMethodName = renderer.fullName + "_open";
  replacedMethods[openMethodName] = md.renderer.rules[openMethodName];

  md.renderer.rules[openMethodName] = function (tokens, idx) {
    var classy, result;

    // first get the result as per the original method we replaced
    result = replacedMethods[openMethodName].apply(null, arguments).trim();

    if (renderer.inline) {
      classy = getClassyFromInlineElement(tokens, idx, renderer.fullName);
    } else {
      classy = getClassyFromBlockElement(tokens, idx, renderer.fullName);
    }

    if (classy) {
      result = result.replace(new RegExp("<" + renderer.pattern), "$& class=\"" + classy.content + "\"");
    }

    return result;
  };
}
function replaceRenderer(md, renderer) {
  var openMethodName = renderer.fullName + "_open";
  replacedMethods[openMethodName] = md.renderer.rules[openMethodName];

  md.renderer.rules[openMethodName] = function (tokens, idx) {
    var classy, result;

    // first get the result as per the original method we replaced
    result = replacedMethods[openMethodName].apply(null, arguments).trim();

    if (renderer.inline) {
      classy = getClassyFromInlineElement(tokens, idx, renderer.fullName);
    } else {
      classy = getClassyFromBlockElement(tokens, idx, renderer.fullName);
    }

    if (classy) {
      result = result.replace(new RegExp("<" + renderer.pattern), "$& class=\"" + classy.content + "\"");
    }

    return result;
  };
}
function replaceRenderer ( md , renderer ) { var openMethodName = renderer . fullName + "_open" ; replacedMethods [ openMethodName ] = md . renderer . rules [ openMethodName ] ; md . renderer . rules [ openMethodName ] = function ( tokens , idx ) { var classy , result ; // first get the result as per the original method we replaced result = replacedMethods [ openMethodName ] . apply ( null , arguments ) . trim ( ) ; if ( renderer . inline ) { classy = getClassyFromInlineElement ( tokens , idx , renderer . fullName ) ; } else { classy = getClassyFromBlockElement ( tokens , idx , renderer . fullName ) ; } if ( classy ) { result = result . replace ( new RegExp ( "<" + renderer . pattern ) , "$& class=\"" + classy . content + "\"" ) ; } return result ; } ; }
replace all rules that we want to enable classy on
replace all rules that we want to enable classy on