Show More
@@ -19,7 +19,7 b' class QuotePattern(Pattern):' | |||
|
19 | 19 | def handleMatch(self, m): |
|
20 | 20 | quote_element = etree.Element('span') |
|
21 | 21 | quote_element.set('class', 'quote') |
|
22 |
quote_element.text = m.group( |
|
|
22 | quote_element.text = m.group(2) | |
|
23 | 23 | |
|
24 | 24 | return quote_element |
|
25 | 25 | |
@@ -29,7 +29,7 b' class ReflinkPattern(Pattern):' | |||
|
29 | 29 | ref_element = etree.Element('a') |
|
30 | 30 | post_id = m.group(4) |
|
31 | 31 | ref_element.set('href', '#' + str(post_id)) |
|
32 |
ref_element.text = |
|
|
32 | ref_element.text = m.group(2) | |
|
33 | 33 | |
|
34 | 34 | return ref_element |
|
35 | 35 | |
@@ -54,8 +54,8 b' class CommentPattern(Pattern):' | |||
|
54 | 54 | |
|
55 | 55 | class NeboardMarkdown(markdown.Extension): |
|
56 | 56 | AUTOLINK_PATTERN = r'(https?://\S+)' |
|
57 |
QUOTE_PATTERN = r'^( |
|
|
58 |
REFLINK_PATTERN = r'(( |
|
|
57 | QUOTE_PATTERN = r'^(?<!>)(>[^>]+)$' | |
|
58 | REFLINK_PATTERN = r'((>>)(\d+))' | |
|
59 | 59 | SPOILER_PATTERN = r'%%(.+)%%' |
|
60 | 60 | COMMENT_PATTERN = r'^(//(.+))' |
|
61 | 61 | |
@@ -67,10 +67,12 b' class NeboardMarkdown(markdown.Extension' | |||
|
67 | 67 | comment = CommentPattern(self.COMMENT_PATTERN, md) |
|
68 | 68 | |
|
69 | 69 | md.inlinePatterns[u'autolink_ext'] = autolink |
|
70 | md.inlinePatterns.add(u'reflink', reflink, '<entity') | |
|
71 | md.inlinePatterns.add(u'quote', quote, '<entity') | |
|
72 | 70 | md.inlinePatterns[u'spoiler'] = spoiler |
|
73 | 71 | md.inlinePatterns[u'comment'] = comment |
|
72 | md.inlinePatterns[u'reflink'] = reflink | |
|
73 | md.inlinePatterns[u'quote'] = quote | |
|
74 | ||
|
75 | del md.parser.blockprocessors['quote'] | |
|
74 | 76 | |
|
75 | 77 | |
|
76 | 78 | def makeExtension(configs=None): |
@@ -80,4 +82,4 b' neboard_extension = makeExtension()' | |||
|
80 | 82 | |
|
81 | 83 | |
|
82 | 84 | def markdown_extended(markup): |
|
83 | return markdown.markdown(markup, [neboard_extension]) | |
|
85 | return markdown.markdown(markup, [neboard_extension], safe_mode=True) |
@@ -211,7 +211,7 b' class Post(models.Model):' | |||
|
211 | 211 | title = models.CharField(max_length=TITLE_MAX_LENGTH) |
|
212 | 212 | pub_time = models.DateTimeField() |
|
213 | 213 | text = MarkupField(default_markup_type=DEFAULT_MARKUP_TYPE, |
|
214 |
escape_html= |
|
|
214 | escape_html=False) | |
|
215 | 215 | image = thumbs.ImageWithThumbsField(upload_to=_update_image_filename, |
|
216 | 216 | blank=True, sizes=(IMAGE_THUMB_SIZE,)) |
|
217 | 217 | poster_ip = models.IPAddressField() |
@@ -189,9 +189,8 b' blockquote {' | |||
|
189 | 189 | } |
|
190 | 190 | |
|
191 | 191 | .quote { |
|
192 | color: greenyellow; | |
|
192 | color: #92cf38; | |
|
193 | 193 | padding-left: 5px; |
|
194 | border-left: solid 2px greenyellow; | |
|
195 | 194 | } |
|
196 | 195 | |
|
197 | 196 | .spoiler { |
@@ -204,7 +203,7 b' blockquote {' | |||
|
204 | 203 | } |
|
205 | 204 | |
|
206 | 205 | .comment { |
|
207 |
color: |
|
|
206 | color: #5dbcb7; | |
|
208 | 207 | } |
|
209 | 208 | |
|
210 | 209 | a:hover { |
General Comments 0
You need to be logged in to leave comments.
Login now