eric6/UI/Previewers/MarkdownExtensions.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7524
282680dae446
permissions
-rw-r--r--

Updated copyright for 2021.

7314
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7524
diff changeset
3 # Copyright (c) 2019 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
7314
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing some Markdown extensions.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import re
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from markdown.extensions import Extension
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from markdown.preprocessors import Preprocessor
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from markdown.inlinepatterns import SimpleTagInlineProcessor
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 ######################################################################
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 ## Code below is an enhanced copy of the Mermaid extension
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 ##
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 ## Original code Copyright 2018-2020 [Olivier Ruelle]
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 ## License: GNU GPLv3
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 ######################################################################
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 MermaidRegex = re.compile(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 r"^(?P<mermaid_sign>[\~\`]){3}[ \t]*[Mm]ermaid[ \t]*$"
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 )
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 MermaidRegexFullText = re.compile(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 r"([\~\`]){3}[ \t]*[Mm]ermaid"
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 )
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 class MermaidPreprocessor(Preprocessor):
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 Class implementing a markdown pre-processor for Mermaid.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 def run(self, lines):
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 Public method to do the pre-processing.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 @param lines text lines to be processed
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 @type list of str
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 @return processed lines
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @rtype list of str
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 new_lines = []
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 mermaid_sign = ""
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 m_start = None
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 m_end = None
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 in_mermaid_code = False
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 is_mermaid = False
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 old_line = ""
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 for line in lines:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 # Wait for starting line with MermaidRegex
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 # (~~~ or ``` following by [mM]ermaid )
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 if not in_mermaid_code:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 m_start = MermaidRegex.match(line)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 else:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 m_end = re.match(r"^[" + mermaid_sign + "]{3}[ \t]*$", line)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 if m_end:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 in_mermaid_code = False
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 if m_start:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 in_mermaid_code = True
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 mermaid_sign = m_start.group("mermaid_sign")
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 if not re.match(r"^[\ \t]*$", old_line):
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 new_lines.append("")
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 if not is_mermaid:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 is_mermaid = True
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 new_lines.append('<div class="mermaid">')
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 m_start = None
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 elif m_end:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 new_lines.append('</div>')
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 new_lines.append("")
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 m_end = None
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 elif in_mermaid_code:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 new_lines.append(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 line.strip()
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 .replace("<", "&lt;")
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 .replace(">", "&gt;")
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 )
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 else:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 new_lines.append(line)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 old_line = line
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 if is_mermaid:
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 new_lines.append('')
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 return new_lines
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 class MermaidExtension(Extension):
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 Class implementing a Markdown Extension for Mermaid.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 def extendMarkdown(self, md, md_globals):
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 Public method to register the extension.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 @param md reference to markdown
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 @param md_globals global config parameters
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 md.preprocessors.register(MermaidPreprocessor(md), 'mermaid', 35)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 md.registerExtension(self)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 ######################################################################
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 ## Some extension to some basic additions
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 ######################################################################
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 class SimplePatternExtension(Extension):
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 Class implementing a Markdown extension for ~, ~~, ^, ^^ and ==.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 Note: This is a very simple pattern extension that might conflict with
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 formulas set for MathJax. Use the 'pymdown-extensions' package in this
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 case.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 DEL_RE = r'(~~)(.+?)~~'
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 SUB_RE = r'(~)(.+?)~'
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 INS_RE = r'(\^\^)(.*?)\^\^'
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 SUP_RE = r'(\^)(.*?)\^'
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 MARK_RE = r'(==)(.*?)=='
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 def extendMarkdown(self, md):
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 Public method to register the extension.
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 @param md reference to markdown
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 """
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 md.inlinePatterns.register(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 SimpleTagInlineProcessor(self.SUB_RE, 'sub'), 'subscript', 30)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 md.inlinePatterns.register(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 SimpleTagInlineProcessor(self.DEL_RE, 'del'), 'deleted', 40)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 md.inlinePatterns.register(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 SimpleTagInlineProcessor(self.SUP_RE, 'sup'), 'superscript', 30)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 md.inlinePatterns.register(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 SimpleTagInlineProcessor(self.INS_RE, 'ins'), 'inserted', 40)
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 md.inlinePatterns.register(
c32c24345ca7 PreviewerHTML, ExporterHTML:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 SimpleTagInlineProcessor(self.MARK_RE, 'mark'), 'mark', 40)

eric ide

mercurial