How to use the markdown.inlinepatterns.SimpleTagPattern function in Markdown

To help you get started, we’ve selected a few Markdown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PageBot / PageBot / Lib / pagebot / contributions / markdown / inline.py View on Github external
ins_tag = SimpleTagPattern(INS_RE, 'ins')
        md.inlinePatterns.add('ins', ins_tag, '>del')
        # "Quote" converts to <q>Quote</q>
        q_tag = SimpleTagPattern(Q_RE, 'q')
        md.inlinePatterns.add('q', q_tag, '&gt;ins')
        # ==Mark== converts to <mark>..</mark>
        mark_tag = SimpleTagPattern(MARK_RE, 'mark')
        md.inlinePatterns.add('mark', mark_tag, '&gt;q')
        # _Underline_ converts to <u>Underline</u>
        u_tag = SimpleTagPattern(U_RE, 'u')
        md.inlinePatterns.add('ins', u_tag, '&gt;mark')
        # ^Sup converts to <sup>Sup</sup>
        sup_tag = SimpleTagPattern(SUP_RE, 'sup')
        md.inlinePatterns.add('sup', sup_tag, '&gt;ins')
        # !!Sub converts to <sub>Sub</sub>
        sub_tag = SimpleTagPattern(SUB_RE, 'sub')
        md.inlinePatterns.add('sub', sub_tag, '&gt;sup')

        # [[Dropcap]] converts to <span class="dropcap">&gt;Sub</span>
        dropcap_tag = SimpleTagPattern(DROPCAP_RE, 'dropcap')
        md.inlinePatterns.add('dropcap', dropcap_tag, '&gt;sub')

        strong_tag = SimpleTagPattern(STRONG_RE, 'strong')
        md.inlinePatterns['strong'] = strong_tag
        em_tag = SimpleTagPattern(EM_RE, 'em')
        md.inlinePatterns['em'] = em_tag
        emph_tag = SimpleTagPattern(EMPH_RE, 'emphasis')
        md.inlinePatterns['emphasis'] = emph_tag


        del md.inlinePatterns['strong_em']
        del md.inlinePatterns['em_strong']
github drewbarontini / dotfiles / sublime-text / Packages / pymdownx / st3 / pymdownx / betterem.py View on Github external
under_strong_em2 = SMART_UNDER_STRONG_EM2 if enable_under else UNDER_STRONG_EM2
        star_strong = SMART_STAR_STRONG if enable_star else STAR_STRONG
        under_strong = SMART_UNDER_STRONG if enable_under else UNDER_STRONG
        star_emphasis = SMART_STAR_EM if enable_star else STAR_EM
        under_emphasis = SMART_UNDER_EM if enable_under else UNDER_EM

        md.inlinePatterns["strong_em"] = DoubleTagPattern(star_strong_em, 'strong,em')
        md.inlinePatterns.add("strong_em2", DoubleTagPattern(under_strong_em, 'strong,em'), '>strong_em')
        md.inlinePatterns.link("em_strong", ">strong_em2")
        md.inlinePatterns["em_strong"] = DoubleTagPattern(star_em_strong, 'em,strong')
        md.inlinePatterns.add('em_strong2', DoubleTagPattern(under_em_strong, 'em,strong'), '>em_strong')
        md.inlinePatterns.add('strong_em3', DoubleTagPattern(star_strong_em2, 'strong,em'), '>em_strong2')
        md.inlinePatterns.add('strong_em4', DoubleTagPattern(under_strong_em2, 'strong,em'), '>strong_em3')
        md.inlinePatterns["strong"] = SimpleTagPattern(star_strong, 'strong')
        md.inlinePatterns.add("strong2", SimpleTagPattern(under_strong, 'strong'), '>strong')
        md.inlinePatterns["emphasis"] = SimpleTagPattern(star_emphasis, 'em')
        md.inlinePatterns["emphasis2"] = SimpleTagPattern(under_emphasis, 'em')
github drewbarontini / dotfiles / sublime-text / Packages / pymdownx / st3 / pymdownx / betterem.py View on Github external
star_strong = SMART_STAR_STRONG if enable_star else STAR_STRONG
        under_strong = SMART_UNDER_STRONG if enable_under else UNDER_STRONG
        star_emphasis = SMART_STAR_EM if enable_star else STAR_EM
        under_emphasis = SMART_UNDER_EM if enable_under else UNDER_EM

        md.inlinePatterns["strong_em"] = DoubleTagPattern(star_strong_em, 'strong,em')
        md.inlinePatterns.add("strong_em2", DoubleTagPattern(under_strong_em, 'strong,em'), '>strong_em')
        md.inlinePatterns.link("em_strong", ">strong_em2")
        md.inlinePatterns["em_strong"] = DoubleTagPattern(star_em_strong, 'em,strong')
        md.inlinePatterns.add('em_strong2', DoubleTagPattern(under_em_strong, 'em,strong'), '>em_strong')
        md.inlinePatterns.add('strong_em3', DoubleTagPattern(star_strong_em2, 'strong,em'), '>em_strong2')
        md.inlinePatterns.add('strong_em4', DoubleTagPattern(under_strong_em2, 'strong,em'), '>strong_em3')
        md.inlinePatterns["strong"] = SimpleTagPattern(star_strong, 'strong')
        md.inlinePatterns.add("strong2", SimpleTagPattern(under_strong, 'strong'), '>strong')
        md.inlinePatterns["emphasis"] = SimpleTagPattern(star_emphasis, 'em')
        md.inlinePatterns["emphasis2"] = SimpleTagPattern(under_emphasis, 'em')
github frnsys / nomadic / nomadic / util / md2html.py View on Github external
def extendMarkdown(self, md, md_globals):
        highlight_pattern = SimpleTagPattern(self.HIGHLIGHT_RE, 'mark')
        md.inlinePatterns.add('highlight', highlight_pattern, '_end')

        pdf_pattern = PDFPattern(self.PDF_RE)
        md.inlinePatterns.add('pdf_link', pdf_pattern, '_begin')
github PageBot / PageBot / Lib / pagebot / contributions / markdown / inline.py View on Github external
md.inlinePatterns.add('q', q_tag, '&gt;ins')
        # ==Mark== converts to <mark>..</mark>
        mark_tag = SimpleTagPattern(MARK_RE, 'mark')
        md.inlinePatterns.add('mark', mark_tag, '&gt;q')
        # _Underline_ converts to <u>Underline</u>
        u_tag = SimpleTagPattern(U_RE, 'u')
        md.inlinePatterns.add('ins', u_tag, '&gt;mark')
        # ^Sup converts to <sup>Sup</sup>
        sup_tag = SimpleTagPattern(SUP_RE, 'sup')
        md.inlinePatterns.add('sup', sup_tag, '&gt;ins')
        # !!Sub converts to <sub>Sub</sub>
        sub_tag = SimpleTagPattern(SUB_RE, 'sub')
        md.inlinePatterns.add('sub', sub_tag, '&gt;sup')

        # [[Dropcap]] converts to <span class="dropcap">&gt;Sub</span>
        dropcap_tag = SimpleTagPattern(DROPCAP_RE, 'dropcap')
        md.inlinePatterns.add('dropcap', dropcap_tag, '&gt;sub')

        strong_tag = SimpleTagPattern(STRONG_RE, 'strong')
        md.inlinePatterns['strong'] = strong_tag
        em_tag = SimpleTagPattern(EM_RE, 'em')
        md.inlinePatterns['em'] = em_tag
        emph_tag = SimpleTagPattern(EMPH_RE, 'emphasis')
        md.inlinePatterns['emphasis'] = emph_tag


        del md.inlinePatterns['strong_em']
        del md.inlinePatterns['em_strong']
        del md.inlinePatterns['emphasis2']
github tav / gitfund / mvp / app / gfm.py View on Github external
def extendMarkdown(self, md, md_globals):
        pattern = SimpleTagPattern(STRIKE_RE, 'del')
        md.inlinePatterns.add('gfm-strikethrough', pattern, '_end')
github lucuma / Clay / clay / markdown_ext / md_delinsmark.py View on Github external
def extendMarkdown(self, md, md_globals):
        """Modifies inline patterns."""
        md.inlinePatterns.add('del', SimpleTagPattern(DEL_RE, 'del'), '
github pycom / Pymakr / UI / Previewers / PreviewerHTML.py View on Github external
def extendMarkdown(self, md, md_globals):
                    # Create the del pattern
                    del_tag = markdown.inlinepatterns.SimpleTagPattern(
                        self.DEL_RE, 'del')
                    # Insert del pattern into markdown parser
                    md.inlinePatterns.add('del', del_tag, '>not_strong')
github zulip / zulip / zerver / lib / bugdown / __init__.py View on Github external
reg.register(UserMentionPattern(mention.find_mentions, self), 'usermention', 95)
        reg.register(Tex(r'\B(?[^\n_$](\\\$|[^$\n])*)\$\$(?!\$)\B'), 'tex', 90)
        reg.register(StreamTopicPattern(get_compiled_stream_topic_link_regex(), self), 'topic', 87)
        reg.register(StreamPattern(get_compiled_stream_link_regex(), self), 'stream', 85)
        reg.register(Avatar(AVATAR_REGEX, self), 'avatar', 80)
        reg.register(ModalLink(r'!modal_link\((?P[^)]*), (?P
github PageBot / PageBot / Lib / pagebot / contributions / markdown / inline.py View on Github external
def extendMarkdown(self, md, md_globals):
        # *[[Caption]]* converts to Caption
        caption_tag = SimpleTagPattern(CAPTION_RE, 'caption')
        md.inlinePatterns.add('caption', caption_tag, '&gt;not_strong')
        # ~~Delete~~ converts to <del>Delete</del>
        del_tag = SimpleTagPattern(DEL_RE, 'del')
        md.inlinePatterns.add('del', del_tag, '&gt;caption')
        # __Insert__ converts to <ins>Insert</ins>
        ins_tag = SimpleTagPattern(INS_RE, 'ins')
        md.inlinePatterns.add('ins', ins_tag, '&gt;del')
        # "Quote" converts to <q>Quote</q>
        q_tag = SimpleTagPattern(Q_RE, 'q')
        md.inlinePatterns.add('q', q_tag, '&gt;ins')
        # ==Mark== converts to <mark>..</mark>
        mark_tag = SimpleTagPattern(MARK_RE, 'mark')
        md.inlinePatterns.add('mark', mark_tag, '&gt;q')
        # _Underline_ converts to <u>Underline</u>
        u_tag = SimpleTagPattern(U_RE, 'u')
        md.inlinePatterns.add('ins', u_tag, '&gt;mark')
        # ^Sup converts to <sup>Sup</sup>
        sup_tag = SimpleTagPattern(SUP_RE, 'sup')
        md.inlinePatterns.add('sup', sup_tag, '&gt;ins')
        # !!Sub converts to <sub>Sub</sub>
        sub_tag = SimpleTagPattern(SUB_RE, 'sub')
        md.inlinePatterns.add('sub', sub_tag, '&gt;sup')