<commit_before>import markdownParser from 'marked';
import { getSrcset, constructThumborUrl } from 'src/config/constants';

const markdownOptions = {
  gfm: true,
  smartypants: true,
};

export const marked = (str, options = {
  lqip: true,
}) => {
  const renderer = new markdownParser.Renderer();
  renderer.image = (href, title, text) => {
    const useLqip = href.indexOf('//adie.bisnaer.ch/') >= 0 && options.lqip;
    let srcset = false;
    let lqipSrc = false;
    let noZoom = false;
    let src = href;
    // Filter self hosted images as well as jpgs and pngs, no gifs
    if (useLqip) {
      /* eslint no-param-reassign: 0 */
      lqipSrc = href;
      noZoom = true;
      src = constructThumborUrl(href, {
        width: 20,<commit_msg>Prevent other images than "real post images" from being optimized<commit_after>import markdownParser from 'marked';
import { getSrcset, constructThumborUrl } from 'src/config/constants';

const markdownOptions = {
  gfm: true,
  smartypants: true,
};

export const marked = (str, options = {
  lqip: true,
}) => {
  const renderer = new markdownParser.Renderer();
  renderer.image = (href, title, text) => {
    const useLqip = href.indexOf('//adie.bisnaer.ch/i/') >= 0 && options.lqip;
    let srcset = false;
    let lqipSrc = false;
    let noZoom = false;
    let src = href;
    // Filter self hosted images as well as jpgs and pngs, no gifs
    if (useLqip) {
      /* eslint no-param-reassign: 0 */
      lqipSrc = href;
      noZoom = true;
      src = constructThumborUrl(href, {
        width: 20,
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 2.9923273657289005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2189366', 'n_tokens_mistral': 546, 'n_tokens_neox': 534, 'n_words': 152}