<commit_before>//
//  DownMarkdownRenderer.swift
//  Eurofurence
//
//  Created by <NAME> on 26/07/18.
//  Copyright © 2018 Eurofurence. All rights reserved.
//

import Foundation
import Down

struct DownMarkdownRenderer: MarkdownRenderer {

	func render(_ contents: String) -> NSAttributedString {
		let down = Down(markdownString: contents)
		do {
			return try down.toAttributedString()
		} catch {
			return NSAttributedString(string: contents)
		}
	}

}
<commit_msg>#154: Changed DownMarkdownRenderer from struct to protocol<commit_after>//
//  DownMarkdownRenderer.swift
//  Eurofurence
//
//  Created by <NAME> on 26/07/18.
//  Copyright © 2018 Eurofurence. All rights reserved.
//

import Foundation
import Down

protocol DownMarkdownRenderer: MarkdownRenderer {
	var stylesheet: String? { get }
}

extension DownMarkdownRenderer {
	func render(_ contents: String) -> NSAttributedString {
		let down = Down(markdownString: contents)
		do {
			return try down.toAttributedString(stylesheet: stylesheet)
		} catch {
			return NSAttributedString(string: contents)
		}
	}

}

{'fraction_non_alphanumeric': 0.1010194624652456, 'fraction_numerical': 0.021316033364226137, 'mean_word_length': 3.8868778280542986, 'pattern_counts': {'":': 0, '<': 5, '<?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': '379675', 'n_tokens_mistral': 378, 'n_tokens_neox': 328, 'n_words': 91}