Thanks to jscs for these functions :) 
Renders single line of code in style error formatted output.

@param {Number} n line number
@param {String} line
@returns {String}
345130
function renderLine(n, line) {
    // Convert tabs to spaces, so errors in code lines with tabs as indention symbol
    // could be correctly rendered, plus it will provide less verbose output
    line = line.replace(/\t/g, ' ');

    // "n + 1" to print lines in human way (counted from 1)
    var lineNumber = prependSpaces((n + 1).toString(), 5) + ' |';
    return ' ' + lineNumber + line;
}
313500
function formatLines(lines, jsDoc, trim) {
  jsDoc = undefined === jsDoc || true;
  trim  = undefined === trim  || true;
  lines = lines.slice();
  
  for (var i = 0; i < lines.length; i++) {
    var line = lines[i] + '';

    if (jsDoc) {
      line = line.replace(/^\s*\*/, '');
    }

    if ('right' === trim) {
      line = line.replace(/\s+$/, '');
    } else if (trim) {
      line = line.trim();
    }

    lines[i] = line;
  }

  lines = arrayTrim(lines);
  
  return lines;
}
390690
def process_line(line)
      case line.text[0]
      when DIV_CLASS; push div(line)
      when DIV_ID
        return push plain(line) if %w[{ @ $].include?(line.text[1])
        push div(line)
      when ELEMENT; push tag(line)
      when COMMENT; push comment(line.text[1..-1].lstrip)
      when SANITIZE
        return push plain(line.strip!(3), :escape_html) if line.text[1, 2] == '=='
        return push script(line.strip!(2), :escape_html) if line.text[1] == SCRIPT
        return push flat_script(line.strip!(2), :escape_html) if line.text[1] == FLAT_SCRIPT
        return push plain(line.strip!(1), :escape_html) if line.text[1] == ?\s || line.text[1..2] == '#{'
        push plain(line)
      when SCRIPT
        return push plain(line.strip!(2)) if line.text[1] == SCRIPT
        line.text = line.text[1..-1]
        push script(line)
      when FLAT_SCRIPT; push flat_script(line.strip!(1))
      when SILENT_SCRIPT
        return push haml_comment(line.text[2..-1]) if line.text[1] == SILENT_COMMENT
        push silent_script(line)
      when FILTER; push filter(line.text[1..-1].downcase)
      when DOCTYPE
        return push doctype(line.text) if line.text[0, 3] == '!!!'
        return push plain(line.strip!(3), false) if line.text[1, 2] == '=='
        return push script(line.strip!(2), false) if line.text[1] == SCRIPT
        return push flat_script(line.strip!(2), false) if line.text[1] == FLAT_SCRIPT
        return push plain(line.strip!(1), false) if line.text[1] == ?\s || line.text[1..2] == '#{'
        push plain(line)
      when ESCAPE
        line.text = line.text[1..-1]
        push plain(line)
      else; push plain(line)
      end
    end
747304
function format(source, style) {
	if (style.insert_final_newline !== undefined) {
		const has = hasTrailingNewLine(source);
		if (style.insert_final_newline && !has) {
			source += '\n';
		} else if (!style.insert_final_newline && has) {
			source = source.replace(TRAILING_NEW_LINE_REGEXP, '');
		}
	}

	return source;
}
684458
function lineTop (){
    var l = line(chars.top
               , chars['top-left'] || chars.top
               , chars['top-right'] ||  chars.top
               , chars['top-mid']);
    if (l)
      ret += l + "\n";
  }
1208389
function processLine (context, comment) {
  const parsed = parse(COMMENT_DIRECTIVE_L, comment.value)
  if (parsed != null && comment.loc.start.line === comment.loc.end.line) {
    const line = comment.loc.start.line + (parsed.type === 'eslint-disable-line' ? 0 : 1)
    const column = -1
    disable(context, { line, column }, 'line', parsed.rules)
    enable(context, { line: line + 1, column }, 'line', parsed.rules)
  }
}
13458
def format_result(line, line_num, txt):
    
    
    return '&nbsp;&nbsp;' + str(line_num) + ': ' + line.replace(txt, '<span style="background-color: #FFFF00">' + txt + '</span>')
892968
function(code)
  {
    var lineNumbers = [],
        lines = this.lines,
        firstLine = parseInt(this.opts.firstLine || 1),
        i,
        l
        ;

    for (i = 0, l = lines.length; i < l; i++)
      lineNumbers.push(i + firstLine);

    return lineNumbers;
  }
1019304
function (line) {
    var pieces = line.split(' ')

    // Header string pieces
    var output = {
      version: pieces.shift(),
      status: parseFloat(pieces.shift()),
      statusText: pieces.join(' ')
    }

    return output
  }
1174191
function formatPost(post){
  var lines=post.split('\n');
  var result = '<h1>'+lines[0]+'</h1>'
              + '<h2>'+lines[1]+'</h2>';
  for(var i=2;i<lines.length;i++)
      result +='<p>'+lines[i]+'</p>';
  
  return result;
}
795531
private String processIndexLine(String line) throws IOException {
        if (line.trim().equals(MDW_ADMIN_CSS)) {
            // insert custom user stylesheets
            String indent = line.substring(0, line.indexOf(MDW_ADMIN_CSS));
            StringBuffer insert = new StringBuffer(line);
            for (File cssFile : WebAppContext.listOverrideFiles("css")) {
                insert.append("\n").append(indent);
                insert.append("<link rel=\"stylesheet\" href=\"css/");
                insert.append(cssFile.getName());
                insert.append("\">");
            }
            return insert.toString();
        }
        else if (line.trim().equals(MDW_ADMIN_JS)) {
            // insert custom user scripts
            String indent = line.substring(0, line.indexOf(MDW_ADMIN_JS));
            StringBuffer insert = new StringBuffer(line);
            for (File jsFile : WebAppContext.listOverrideFiles("js")) {
                insert.append("\n").append(indent);
                insert.append("<script src=\"js/");
                insert.append(jsFile.getName());
                insert.append("\"></script>");
            }
            return insert.toString();
        }
        else {
            return line;
        }
    }
693446
function (lines) {
    var regex = /[ ,]+/;
    // header= <num_data> <num_classes> 1
    var header = lines[0].split(regex);
    if (header.length < 3) {
      throw new Error('Header line needs three numbers');
    }
    var headerNumbers = [];
    try {
      for (var i = 0; i < 3; i++) {
        headerNumbers[i] = parseInt($.trim(header[i]));
      }
    }
    catch (e) {
      throw new Error('Header line element ' + i + ' is not a number');
    }
    if (headerNumbers[0] <= 0) {
      throw new Error(
        'Header line missing first number, number of data points');
    }
    if (headerNumbers[1] <= 0) {
      throw new Error(
        'Header line missing second number, number of classes');
    }
    var numClasses = headerNumbers[1];
    var numItems = headerNumbers[0];
    var classDefinitionLine = lines[1];
    classDefinitionLine = classDefinitionLine.substring(classDefinitionLine
      .indexOf('#') + 1);
    var classNames = $.trim(classDefinitionLine).split(regex);
    if (classNames.length < numClasses) {
      throw new Error('First line specifies ' + numClasses
        + ' classes, but found ' + classNames.length + '.');
    }
    var dataLine = lines[2];
    var assignments = dataLine.split(regex);
    // convert the assignments to names
    for (var i = 0; i < assignments.length; i++) {
      var assignment = $.trim(assignments[i]);
      var index = parseInt(assignment);
      var tmp = classNames[index];
      if (tmp !== undefined) {
        assignments[i] = tmp;
      }
    }
    return assignments;
  }
937738
function(inlines) {
  var result = '';
  for (var i=0; i < inlines.length; i++) {
    result = result + this.renderInline(inlines[i]);
  }
  return result;
}
612918
function indent(string, indent) {
    return string.split('\n').map(function (line) {
        return indent + line;
    }).join('\n');
}
474600
private static String addLineNumber(String code) {
		String[] lines = code.split("\n");
		StringBuilder builder = new StringBuilder();
		for (int i = 0; i < lines.length; i++) {
			builder.append("/* ").append(i + 1).append(" */").append(lines[i]).append("\n");
		}
		return builder.toString();
	}
1318120
function HtmlRenderer(){
  return {
    // default options:
    blocksep: '\n',  // space between blocks
    innersep: '\n',  // space between block container tag and contents
    softbreak: '\n', // by default, soft breaks are rendered as newlines in HTML
                     // set to "<br />" to make them hard breaks
                     // set to " " if you want to ignore line wrapping in source
    escape: function(s, preserve_entities) {
      if (preserve_entities) {
      return s.replace(/[&](?![#](x[a-f0-9]{1,8}|[0-9]{1,8});|[a-z][a-z0-9]{1,31};)/gi,'&amp;')
              .replace(/[<]/g,'&lt;')
              .replace(/[>]/g,'&gt;')
              .replace(/["]/g,'&quot;');
      } else {
      return s.replace(/[&]/g,'&amp;')
              .replace(/[<]/g,'&lt;')
              .replace(/[>]/g,'&gt;')
              .replace(/["]/g,'&quot;');
      }
    },
    renderInline: renderInline,
    renderInlines: renderInlines,
    renderBlock: renderBlock,
    renderBlocks: renderBlocks,
    render: renderBlock
  };
}
930930
function markdown(text, nohl) {
    let r, codes;

    md.set({
      highlight: (str, lang) => {
        let esc = md.utils.escapeHtml;

        try {
          if (lang && lang !== 'auto' && hljs.getLanguage(lang)) {
            return '<pre class="hljs language-' + esc(lang.toLowerCase()) + '"><code>' +
                   hljs.highlight(lang, str, true).value +
                   '</code></pre>';

          } else if (!lang || lang === 'auto') {
            let result = hljs.highlightAuto(str);

            return '<pre class="hljs language-' + esc(result.language) + '"><code>' +
                   result.value +
                   '</code></pre>';
          }
        } catch (__) { /**/ }

        return '<pre class="hljs"><code>' + esc(str) + '</code></pre>';
      }
    });

    md.renderer.rules['code_block'] = function (tokens, idx /*, options, env */) {
      let esc = md.utils.escapeHtml;
      return '<pre class="hljs"><code>' + esc(tokens[idx].content) + '</code></pre>\n';
    };

    if (nohl) md.set({ highlight: null });

    r = md.render(text);

    // FIXME
    // desugar [[foo#bar]] tokens into local links
    // N.B. in order to not apply conversion in <code> blocks,
    // we first store replace code blocks with nonces
    codes = {};
    r = r.replace(/(<code>[\s\S]*?<\/code>)/g, (all, def) => {
      let nonce = Math.random().toString().substring(2);
      codes[nonce] = def;
      return `@-=@=-@${nonce}@-=@=-@`;
    });

    // convert [[link]] to links
    r = r.replace(/\[\[([\s\S]+?)\]\]/g, (all, def) => {
      def = def.split(/\s+/);
      id = def.shift();
      // invalid references don't produce links
      if (!list[id]) {
        if (options.brokenLinks === 'throw') {
          throw new Error(`Link is broken: ${all}\n${r}`);
        }
        return options.brokenLinks === 'show' ? all : id;
      }

      let obj = _.extend({ name: def.join(' ') || id }, list[id]);
      return link(obj, false, [ 'link-short' ]);
    });
    // restore code blocks, given previously stored nonces
    r = r.replace(/@-=@=-@(\d+)@-=@=-@/g, (all, nonce) => codes[nonce]);
    //
    return r;
  }