<commit_before>'use strict';

// Node modules
const He = require('he');
const Marked = require('marked');
const Striptags = require('striptags');
const Trim = require('trim');

// Create a custom renderer
let renderer = new Marked.Renderer();

// Convert code blocks to <pre data-code="js"> instead of <pre><code class="lang-js">
renderer.code = (code, lang) => {
  let pre;

  pre = lang ? '<pre data-code="' + He.encode(lang, { useNamedReferences: true }) + '">' : '<pre>';
  pre += He.encode(code, { useNamedReferences: true });
  pre += '</pre>';

  return pre;
};

const self = {<commit_msg>Fix bug where Quick Post generated wrong markup for code blocks<commit_after>'use strict';

// Node modules
const He = require('he');
const Marked = require('marked');
const Striptags = require('striptags');
const Trim = require('trim');

// Create a custom renderer
let renderer = new Marked.Renderer();

// Convert code blocks to <pre data-code="js"> instead of <pre><code class="lang-js">
renderer.code = (code, lang) => {
  let pre;

  pre = lang ? '<pre class="language-' + He.encode(lang, { useNamedReferences: true }) + '">' : '<pre>';
  pre += He.encode(code, { useNamedReferences: true });
  pre += '</pre>';

  return pre;
};

const self = {
{'fraction_non_alphanumeric': 0.18283881315156375, 'fraction_numerical': 0.0, 'mean_word_length': 4.31063829787234, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2236683', 'n_tokens_mistral': 400, 'n_tokens_neox': 388, 'n_words': 124}