<commit_before># -*- coding: utf-8 -*-
"""
==============================
Markdown Superscript Extension
==============================

Extends the Python-Markdown library to support superscript text.

Given the text:
    2^10^ is 1024.
Will output:
    2<sup>10</sup> is 1024.

:website: https://github.com/jambonrose/markdown_superscript_extension
:copyright: Copyright 2014 <NAME>
:license: Simplified BSD, see LICENSE for details.
"""

from __future__ import unicode_literals
from markdown import Extension
from markdown.inlinepatterns import SimpleTagPattern


# match ^, at least one character that is not ^, and ^ again
SUPERSCRIPT_RE = r'(\^)([^\^]+)\2'


def makeExtension(configs=None):
    """Inform Markdown of the existence of the extension."""
    return SuperscriptExtension(configs=dict(configs))


class SuperscriptExtension(Extension):
    """Extension: text between ^ characters will be superscripted."""

    def extendMarkdown(self, md, md_globals):
        """Insert 'superscript' pattern before 'not_strong' pattern."""
        md.inlinePatterns.add('superscript',
                              SimpleTagPattern(SUPERSCRIPT_RE, 'sup'),
                              '<not_strong')<commit_msg>Fixed #1 by changing function signature. Thanks @adi- !<commit_after># -*- coding: utf-8 -*-
"""
==============================
Markdown Superscript Extension
==============================

Extends the Python-Markdown library to support superscript text.

Given the text:
    2^10^ is 1024.
Will output:
    2<sup>10</sup> is 1024.

:website: https://github.com/jambonrose/markdown_superscript_extension
:copyright: Copyright 2014 <NAME>
:license: Simplified BSD, see LICENSE for details.
"""

from __future__ import unicode_literals
from markdown import Extension
from markdown.inlinepatterns import SimpleTagPattern


# match ^, at least one character that is not ^, and ^ again
SUPERSCRIPT_RE = r'(\^)([^\^]+)\2'


def makeExtension(*args, **kwargs):
    """Inform Markdown of the existence of the extension."""
    return SuperscriptExtension(*args, **kwargs)


class SuperscriptExtension(Extension):
    """Extension: text between ^ characters will be superscripted."""

    def extendMarkdown(self, md, md_globals):
        """Insert 'superscript' pattern before 'not_strong' pattern."""
        md.inlinePatterns.add('superscript',
                              SimpleTagPattern(SUPERSCRIPT_RE, 'sup'),
                              '<not_strong')
{'fraction_non_alphanumeric': 0.15742614326183732, 'fraction_numerical': 0.01659247268312424, 'mean_word_length': 3.934131736526946, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '3579563', 'n_tokens_mistral': 728, 'n_tokens_neox': 671, 'n_words': 203}