Show More
@@ -116,7 +116,7 b' class CodePattern(TextFormatter):' | |||||
116 |
|
116 | |||
117 | def render_reflink(tag_name, value, options, parent, context): |
|
117 | def render_reflink(tag_name, value, options, parent, context): | |
118 | if not REFLINK_PATTERN.match(value): |
|
118 | if not REFLINK_PATTERN.match(value): | |
119 |
return |
|
119 | return '>>%s' % value | |
120 |
|
120 | |||
121 | post_id = int(value) |
|
121 | post_id = int(value) | |
122 |
|
122 | |||
@@ -124,21 +124,21 b' def render_reflink(tag_name, value, opti' | |||||
124 | if posts.exists(): |
|
124 | if posts.exists(): | |
125 | post = posts[0] |
|
125 | post = posts[0] | |
126 |
|
126 | |||
127 |
return |
|
127 | return '<a href="%s">>>%s</a>' % (post.get_url(), post_id) | |
128 | else: |
|
128 | else: | |
129 |
return |
|
129 | return '>>%s' % value | |
130 |
|
130 | |||
131 |
|
131 | |||
132 | def render_quote(tag_name, value, options, parent, context): |
|
132 | def render_quote(tag_name, value, options, parent, context): | |
133 |
source = |
|
133 | source = '' | |
134 | if 'source' in options: |
|
134 | if 'source' in options: | |
135 | source = options['source'] |
|
135 | source = options['source'] | |
136 |
|
136 | |||
137 |
result = |
|
137 | result = '' | |
138 | if source: |
|
138 | if source: | |
139 |
result = |
|
139 | result = '<div class="multiquote"><div class="quote-header">%s</div><div class="quote-text">%s</div></div>' % (source, value) | |
140 | else: |
|
140 | else: | |
141 |
result = |
|
141 | result = '<div class="multiquote"><div class="quote-text">%s</div></div>' % value | |
142 |
|
142 | |||
143 | return result |
|
143 | return result | |
144 |
|
144 | |||
@@ -152,7 +152,9 b' def preparse_text(text):' | |||||
152 |
|
152 | |||
153 |
|
153 | |||
154 | def bbcode_extended(markup): |
|
154 | def bbcode_extended(markup): | |
155 | parser = bbcode.Parser() |
|
155 | # The newline hack is added because br's margin does not work in all | |
|
156 | # browsers except firefox, when the div's does. | |||
|
157 | parser = bbcode.Parser(newline='<div class="br"></div>') | |||
156 | parser.add_formatter('post', render_reflink, strip=True) |
|
158 | parser.add_formatter('post', render_reflink, strip=True) | |
157 | parser.add_formatter('quote', render_quote, strip=True) |
|
159 | parser.add_formatter('quote', render_quote, strip=True) | |
158 | parser.add_simple_formatter('comment', |
|
160 | parser.add_simple_formatter('comment', |
@@ -101,15 +101,11 b' body {' | |||||
101 | visibility: hidden; |
|
101 | visibility: hidden; | |
102 | } |
|
102 | } | |
103 |
|
103 | |||
104 | p { |
|
104 | p, .br { | |
105 | margin-top: .5em; |
|
105 | margin-top: .5em; | |
106 | margin-bottom: .5em; |
|
106 | margin-bottom: .5em; | |
107 | } |
|
107 | } | |
108 |
|
108 | |||
109 | br { |
|
|||
110 | line-height: 150%; |
|
|||
111 | } |
|
|||
112 |
|
||||
113 | .post-form-w { |
|
109 | .post-form-w { | |
114 | background: #333344; |
|
110 | background: #333344; | |
115 | border-top: solid 1px #888; |
|
111 | border-top: solid 1px #888; |
General Comments 0
You need to be logged in to leave comments.
Login now