##// END OF EJS Templates
Added source parameter to quotes
neko259 -
r755:8eb55ab8 default
parent child Browse files
Show More
@@ -77,6 +77,7 b' class CommentPattern(TextFormatter):'
77 format_right = '[/comment]'
77 format_right = '[/comment]'
78
78
79
79
80 # TODO Use <s> tag here
80 class StrikeThroughPattern(TextFormatter):
81 class StrikeThroughPattern(TextFormatter):
81 name = 's'
82 name = 's'
82 preview_left = '<span class="strikethrough">'
83 preview_left = '<span class="strikethrough">'
@@ -128,6 +129,20 b' def render_reflink(tag_name, value, opti'
128 return u'>>%s' % value
129 return u'>>%s' % value
129
130
130
131
132 def render_quote(tag_name, value, options, parent, context):
133 source = u''
134 if 'source' in options:
135 source = options['source']
136
137 result = u''
138 if source:
139 result = u'<div class="multiquote"><div class="quote-header">%s</div><div class="quote-text">%s</div></div>' % (source, value)
140 else:
141 result = u'<div class="multiquote"><div class="quote-text">%s</div></div>' % value
142
143 return result
144
145
131 def preparse_text(text):
146 def preparse_text(text):
132 """
147 """
133 Performs manual parsing before the bbcode parser is used.
148 Performs manual parsing before the bbcode parser is used.
@@ -139,8 +154,7 b' def preparse_text(text):'
139 def bbcode_extended(markup):
154 def bbcode_extended(markup):
140 parser = bbcode.Parser()
155 parser = bbcode.Parser()
141 parser.add_formatter('post', render_reflink, strip=True)
156 parser.add_formatter('post', render_reflink, strip=True)
142 parser.add_simple_formatter('quote',
157 parser.add_formatter('quote', render_quote, strip=True)
143 u'<span class="multiquote">%(value)s</span>', strip=True)
144 parser.add_simple_formatter('comment',
158 parser.add_simple_formatter('comment',
145 u'<span class="comment">//%(value)s</span>')
159 u'<span class="comment">//%(value)s</span>')
146 parser.add_simple_formatter('spoiler',
160 parser.add_simple_formatter('spoiler',
@@ -430,6 +430,14 b' ul {'
430 padding-left: 0px;
430 padding-left: 0px;
431 }
431 }
432
432
433 .quote-header {
434 border-bottom: 2px solid #ddd;
435 margin-bottom: 1ex;
436 padding-bottom: .5ex;
437 color: #ddd;
438 font-size: 1.2em;
439 }
440
433 /* Reflink preview */
441 /* Reflink preview */
434 .post_preview {
442 .post_preview {
435 border-left: 1px solid #777;
443 border-left: 1px solid #777;
General Comments 0
You need to be logged in to leave comments. Login now