##// END OF EJS Templates
Replace '--' with 'β€”' character
neko259 -
r699:e0309bfd 1.8-dev
parent child Browse files
Show More
@@ -1,3 +1,5 b''
1 # coding=utf-8
2
1 import markdown
3 import markdown
2 from markdown.inlinepatterns import Pattern, SubstituteTagPattern
4 from markdown.inlinepatterns import Pattern, SubstituteTagPattern
3 from markdown.util import etree
5 from markdown.util import etree
@@ -12,6 +14,7 b" REFLINK_PATTERN = r'((>>)(\\d+))'"
12 SPOILER_PATTERN = r'%%([^(%%)]+)%%'
14 SPOILER_PATTERN = r'%%([^(%%)]+)%%'
13 COMMENT_PATTERN = r'^(//(.+))'
15 COMMENT_PATTERN = r'^(//(.+))'
14 STRIKETHROUGH_PATTERN = r'~(.+)~'
16 STRIKETHROUGH_PATTERN = r'~(.+)~'
17 DASH_PATTERN = r'--'
15
18
16
19
17 class TextFormatter():
20 class TextFormatter():
@@ -144,6 +147,11 b' class CodePattern(TextFormatter):'
144 format_left = ' '
147 format_left = ' '
145
148
146
149
150 class DashPattern(Pattern):
151 def handleMatch(self, m):
152 return u'β€”'
153
154
147 class NeboardMarkdown(markdown.Extension):
155 class NeboardMarkdown(markdown.Extension):
148 def extendMarkdown(self, md, md_globals):
156 def extendMarkdown(self, md, md_globals):
149 self._add_neboard_patterns(md)
157 self._add_neboard_patterns(md)
@@ -162,6 +170,7 b' class NeboardMarkdown(markdown.Extension'
162 spoiler = SpoilerPattern(SPOILER_PATTERN, md)
170 spoiler = SpoilerPattern(SPOILER_PATTERN, md)
163 comment = CommentPattern(COMMENT_PATTERN, md)
171 comment = CommentPattern(COMMENT_PATTERN, md)
164 strikethrough = StrikeThroughPattern(STRIKETHROUGH_PATTERN, md)
172 strikethrough = StrikeThroughPattern(STRIKETHROUGH_PATTERN, md)
173 dash = DashPattern(DASH_PATTERN, md)
165
174
166 md.inlinePatterns[u'autolink_ext'] = autolink
175 md.inlinePatterns[u'autolink_ext'] = autolink
167 md.inlinePatterns[u'spoiler'] = spoiler
176 md.inlinePatterns[u'spoiler'] = spoiler
@@ -169,6 +178,7 b' class NeboardMarkdown(markdown.Extension'
169 md.inlinePatterns[u'comment'] = comment
178 md.inlinePatterns[u'comment'] = comment
170 md.inlinePatterns[u'reflink'] = reflink
179 md.inlinePatterns[u'reflink'] = reflink
171 md.inlinePatterns[u'quote'] = quote
180 md.inlinePatterns[u'quote'] = quote
181 md.inlinePatterns[u'dash'] = dash
172
182
173
183
174 def make_extension(configs=None):
184 def make_extension(configs=None):
General Comments 0
You need to be logged in to leave comments. Login now