<commit_before>﻿using System;
using System.Linq;

using HtmlAgilityPack;

namespace ReverseMarkdown.Converters
{
    public class Pre : ConverterBase
    {
        public Pre(Converter converter) : base(converter)
        {
            Converter.Register("pre", this);
        }

        public override string Convert(HtmlNode node)
        {
            if (Converter.Config.GithubFlavored)
            {
                var lang = GetLanguage(node);
                var code = DecodeHtml(node.InnerText).TrimEnd(new char[] {'\n', '\r'});
                return $"{Environment.NewLine}```{lang}{Environment.NewLine}{code}{Environment.NewLine}```{Environment.NewLine}";
            }
            else
            {
                // get the lines based on carriage return and prefix four spaces to each line
                var lines = node.InnerText.ReadLines().Select(item => $"    {item}{Environment.NewLine}");<commit_msg>Take 2 use two seperate `.TrimEnd()` operations.<commit_after>﻿using System;
using System.Linq;

using HtmlAgilityPack;

namespace ReverseMarkdown.Converters
{
    public class Pre : ConverterBase
    {
        public Pre(Converter converter) : base(converter)
        {
            Converter.Register("pre", this);
        }

        public override string Convert(HtmlNode node)
        {
            if (Converter.Config.GithubFlavored)
            {
                var lang = GetLanguage(node);
                var code = DecodeHtml(node.InnerText).TrimEnd('\n', '\r');
                return $"{Environment.NewLine}```{lang}{Environment.NewLine}{code}{Environment.NewLine}```{Environment.NewLine}";
            }
            else
            {
                // get the lines based on carriage return and prefix four spaces to each line
                var lines = node.InnerText.ReadLines().Select(item => $"    {item}{Environment.NewLine}");
{'fraction_non_alphanumeric': 0.11395101171458999, 'fraction_numerical': 0.0005324813631522897, 'mean_word_length': 2.147403685092127, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1543253', 'n_tokens_mistral': 510, 'n_tokens_neox': 488, 'n_words': 113}