Пример #1
0
    def __init__(self, pattern, config, latex2svg, md):
        """Initialize."""

        self.inline_class = config.get('inline_class', '')
        self.latex2svg = latex2svg

        InlineProcessor.__init__(self, pattern, md)
Пример #2
0
    def __init__(self, pattern, config, md):
        """Initialize."""

        self.config = config
        InlineProcessor.__init__(self, pattern, md)
        self.md = md

        self.formatters = [{
            "name": "inlinehilite",
            "test": _test,
            "formatter": self.highlight_code
        }]

        # Custom Fences
        custom_inline = self.config.get('custom_inline', [])
        for custom in custom_inline:
            name = custom.get('name')
            class_name = custom.get('class')
            inline_format = custom.get('format', self.highlight_code)
            if name is not None and class_name is not None:
                self.extend_custom_inline(
                    name,
                    functools.partial(_formatter,
                                      class_name=class_name,
                                      fmt=inline_format))

        self.get_hl_settings = False
Пример #3
0
    def __init__(self, pattern, md, user, repo, provider, labels):
        """Initialize."""

        self.user = user
        self.repo = repo
        self.labels = labels
        self.provider = provider if provider in PROVIDER_INFO else ''
        InlineProcessor.__init__(self, pattern, md)
Пример #4
0
    def __init__(self, pattern, config):
        """Initialize."""

        # Generic setup
        self.generic = config.get('generic', False)
        wrap = config.get('tex_inline_wrap', ["\\(", "\\)"])
        self.wrap = wrap[0] + '%s' + wrap[1]

        # Default setup
        self.preview = config.get('preview', True)
        InlineProcessor.__init__(self, pattern)
Пример #5
0
    def __init__(self, pattern, config):
        """Initialize."""

        # Generic setup
        self.generic = config.get('generic', False)
        wrap = config.get('tex_inline_wrap', ["\\(", "\\)"])
        self.wrap = wrap[0] + '%s' + wrap[1]

        # Default setup
        self.preview = config.get('preview', True)
        InlineProcessor.__init__(self, pattern)
    def __init__(self, pattern, config):
        """Initialize."""

        # Generic setup
        self.generic = config.get('generic', False)
        wrap = config.get('tex_inline_wrap', ["\\(", "\\)"])
        self.wrap = (wrap[0].replace('{', '}}').replace('}', '}}') + '{}' +
                     wrap[1].replace('{', '}}').replace('}', '}}'))
        self.inline_tag = config.get('inline_tag', 'span')

        # Default setup
        self.preview = config.get('preview', True)
        InlineProcessor.__init__(self, pattern)
Пример #7
0
    def __init__(self, pattern, config, md):
        """Initialize."""

        InlineProcessor.__init__(self, pattern, md)

        title = config['title']
        alt = config['alt']
        self.options = config['options']
        self._set_index(config["emoji_index"])
        self.unicode_alt = alt in UNICODE_ALT
        self.encoded_alt = alt == UNICODE_ENTITY
        self.remove_var_sel = config['remove_variation_selector']
        self.title = title if title in VALID_TITLE else NO_TITLE
        self.generator = config['emoji_generator']
Пример #8
0
    def __init__(self, pattern, config, md):
        """Initialize."""

        title = config['title']
        alt = config['alt']

        self._set_index(config["emoji_index"])
        self.unicode_alt = alt in UNICODE_ALT
        self.encoded_alt = alt == UNICODE_ENTITY
        self.remove_var_sel = config['remove_variation_selector']
        self.title = title if title in VALID_TITLE else NO_TITLE
        self.generator = config['emoji_generator']
        self.options = config['options']
        InlineProcessor.__init__(self, pattern, md)
Пример #9
0
 def __init__(self):
     InlineProcessor.__init__(self, r'\^(' + RE_CU_LETTER + ')')
Пример #10
0
 def __init__(self, pattern):
     InlineProcessor.__init__(self, pattern)
     self.ESCAPED_BSLASH = '{}{}{}'.format(util.STX, ord('\\'), util.ETX)
     self.tag = 'tt'
Пример #11
0
    def __init__(self, pattern, md, config):

        self.config = config

        InlineProcessor.__init__(self, pattern, md)
Пример #12
0
    def __init__(self, pattern, md):
        """Initialize."""

        InlineProcessor.__init__(self, pattern, md)
Пример #13
0
    def __init__(self, pattern, nbsp):
        """Initialize."""

        self.nbsp = nbsp
        InlineProcessor.__init__(self, pattern)
Пример #14
0
 def __init__(self, pattern, config):
     self.profile = config.get("profile", False)[0]
     InlineProcessor.__init__(self, pattern)
Пример #15
0
    def __init__(self, pattern, md):
        """Initialize."""

        InlineProcessor.__init__(self, pattern, md)
Пример #16
0
 def __init__(self):
     InlineProcessor.__init__(self, r'<<(\d+)(?::\s*([^>)]+))?>>')
Пример #17
0
 def __init__(self):
     InlineProcessor.__init__(self, r'\+(\S|\S.*?\S)\+')
Пример #18
0
 def __init__(self):
     InlineProcessor.__init__(self, r'\({2}\s*(.+?)\s*\){2}')