<commit_before>package org.jbake.parser;

import org.pegdown.Extensions;
import org.pegdown.PegDownProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * Renders documents in the Markdown format.
 *
 * @author <NAME>
 */
public class MarkdownEngine extends MarkupEngine {

    private final static Logger LOGGER = LoggerFactory.getLogger(MarkdownEngine.class);

    public MarkdownEngine() {
        Class engineClass = PegDownProcessor.class;
        assert engineClass!=null;
    }


  @Override
    public void processHeader(final ParserContext context) {
      Map<String, Object> contents = context.getContents();
      if(contents.get("title") == null){
        LOGGER.warn("Atribut title: {} ", contents.get("title"));<commit_msg>Patch pour certains cas dans lequel le title retourne null, pas creusé pour le moment.<commit_after>package org.jbake.parser;

import org.pegdown.Extensions;
import org.pegdown.PegDownProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * Renders documents in the Markdown format.
 *
 * @author <NAME>
 */
public class MarkdownEngine extends MarkupEngine {

    private final static Logger LOGGER = LoggerFactory.getLogger(MarkdownEngine.class);

    public MarkdownEngine() {
        Class engineClass = PegDownProcessor.class;
        assert engineClass!=null;
    }


  @Override
    public void processHeader(final ParserContext context) {
      Map<String, Object> contents = context.getContents();
      if(contents.get("title") == null){
        String fileName =  context.getFile().getName();
        String documentName = fileName.substring(0,fileName.lastIndexOf("."));
        contents.put("title",documentName);

{'fraction_non_alphanumeric': 0.10748999428244711, 'fraction_numerical': 0.002858776443682104, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4223949', 'n_tokens_mistral': 503, 'n_tokens_neox': 499, 'n_words': 123}