Show More
@@ -30,7 +30,7 b' MAX_SPOILER_MULTIPLIER = 2' | |||||
30 | MAX_SPOILER_SPACE_COUNT = 20 |
|
30 | MAX_SPOILER_SPACE_COUNT = 20 | |
31 |
|
31 | |||
32 |
|
32 | |||
33 |
class TextFormatter |
|
33 | class TextFormatter: | |
34 | """ |
|
34 | """ | |
35 | An interface for formatter that can be used in the text format panel |
|
35 | An interface for formatter that can be used in the text format panel | |
36 | """ |
|
36 | """ | |
@@ -49,7 +49,7 b' class TextFormatter():' | |||||
49 | format_right = '' |
|
49 | format_right = '' | |
50 |
|
50 | |||
51 |
|
51 | |||
52 |
class AutolinkPattern |
|
52 | class AutolinkPattern: | |
53 | def handleMatch(self, m): |
|
53 | def handleMatch(self, m): | |
54 | link_element = etree.Element('a') |
|
54 | link_element = etree.Element('a') | |
55 | href = m.group(2) |
|
55 | href = m.group(2) | |
@@ -197,9 +197,10 b' def render_notification(tag_name, value,' | |||||
197 | def render_tag(tag_name, value, options, parent, context): |
|
197 | def render_tag(tag_name, value, options, parent, context): | |
198 | tag_name = value.lower() |
|
198 | tag_name = value.lower() | |
199 |
|
199 | |||
200 | try: |
|
200 | tag = boards.models.Tag.objects.get_by_alias(tag_name) | |
201 | url = boards.models.Tag.objects.get(name=tag_name).get_view() |
|
201 | if tag: | |
202 | except ObjectDoesNotExist: |
|
202 | url = tag.get_view() | |
|
203 | else: | |||
203 | url = tag_name |
|
204 | url = tag_name | |
204 |
|
205 | |||
205 | return url |
|
206 | return url | |
@@ -285,5 +286,7 b' class Parser:' | |||||
285 |
|
286 | |||
286 |
|
287 | |||
287 | parser = Parser() |
|
288 | parser = Parser() | |
|
289 | ||||
|
290 | ||||
288 | def get_parser(): |
|
291 | def get_parser(): | |
289 | return parser |
|
292 | return parser |
General Comments 0
You need to be logged in to leave comments.
Login now