<commit_before>import re

from django import template

register = template.Library()


@register.filter
def paragraph_markup(text):
    new_text = re.sub(r"<p[^>]*>", "<p style=\"{% base_styles \'p\' %} font-family: \'Droid Serif\', Georgia, serif; font-size: 16px; line-height: 120%; margin-top: 5px;\">", text, 0)

    return new_text


@register.simple_tag
def base_styles(tag):
    if tag == 'body':
        return '-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; ' \
               'height: 100% !important; margin: 0; padding: 0; ' \
               'width: 100% !important;'
    elif tag == '#bodyTable' or tag == '#bodyCell':
        return 'height: 100% !important; margin: 0; padding: 0; ' \
               'width: 100% !important;'
    elif tag == 'table':
        return '-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;' \
               ' border-collapse: collapse; mso-table-lspace: 0pt; ' \
               'mso-table-rspace: 0pt;'
    elif tag == 'td':
        return '-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; ' \<commit_msg>OCW0-104 #comment fixing paragraph styles<commit_after>import re

from django import template

register = template.Library()


@register.filter
def paragraph_markup(text):
    new_text = re.sub(r"<p[^>]*>", "<p style=\"-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: \'Droid Serif\', Georgia, serif; margin-bottom: 5px; font-size: 16px; line-height: 120%\">", text, 0)

    return new_text


@register.simple_tag
def base_styles(tag):
    if tag == 'body':
        return '-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; ' \
               'height: 100% !important; margin: 0; padding: 0; ' \
               'width: 100% !important;'
    elif tag == '#bodyTable' or tag == '#bodyCell':
        return 'height: 100% !important; margin: 0; padding: 0; ' \
               'width: 100% !important;'
    elif tag == 'table':
        return '-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;' \
               ' border-collapse: collapse; mso-table-lspace: 0pt; ' \
               'mso-table-rspace: 0pt;'
    elif tag == 'td':
        return '-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; ' \
{'fraction_non_alphanumeric': 0.1789237668161435, 'fraction_numerical': 0.04304932735426009, 'mean_word_length': 2.669407894736842, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1188815', 'n_tokens_mistral': 844, 'n_tokens_neox': 728, 'n_words': 189}