<commit_before>package ch.rmy.android.http_shortcuts.utils

import android.os.Build
import android.text.Html
import android.text.Spanned

object HTMLUtil {

    @Suppress("DEPRECATION")
    fun getHTML(string: String): Spanned =
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            Html.fromHtml(string, 0)
        } else {
            Html.fromHtml(string)
        }

    fun format(string: String): Spanned = getHTML(
        string.replace("\n", "<br>")
    )

}<commit_msg>Use monospace font for <pre> in dialogs<commit_after>package ch.rmy.android.http_shortcuts.utils

import android.os.Build
import android.text.Html
import android.text.Spanned

object HTMLUtil {

    fun getHTML(string: String): Spanned =
        fromHTML(normalize(string))

    private fun normalize(string: String): String =
        string.replace("<pre>", "<tt>")
            .replace("</pre>", "</tt>")

    @Suppress("DEPRECATION")
    private fun fromHTML(string: String): Spanned =
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            Html.fromHtml(string, 0)
        } else {
            Html.fromHtml(string)
        }

    fun format(string: String): Spanned = getHTML(
        string.replace("\n", "<br>")
    )

}
{'fraction_non_alphanumeric': 0.13344051446945338, 'fraction_numerical': 0.001607717041800643, 'mean_word_length': 2.75, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, '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': '6892658', 'n_tokens_mistral': 399, 'n_tokens_neox': 387, 'n_words': 79}