Просмотр исходного кода

Merge pull request #550 from HenryChenV/0.5.x

Merged, but I'll take a while to make release, as I would like to add few extra fixes to 0.5 branch before that.
Rafał Pitoń 9 лет назад
Родитель
Сommit
b502848aa4

+ 4 - 3
misago/templatetags/md.py

@@ -26,8 +26,9 @@ def short_markdown(value, length=300):
     value = ' '.join(value.splitlines())
     value = ' '.join(value.splitlines())
     value = value[0:length]
     value = value[0:length]
 
 
-    while value[-1] != ' ':
-        value = value[0:-1]
+    if ' ' in value:
+        while value[-1] != ' ':
+            value = value[0:-1]
 
 
     value = value.strip()
     value = value.strip()
     if value[-3:3] != '...':
     if value[-3:3] != '...':
@@ -38,4 +39,4 @@ def short_markdown(value, length=300):
 
 
 @register.filter(name='markdown_final')
 @register.filter(name='markdown_final')
 def finalize_markdown(value):
 def finalize_markdown(value):
-    return misago.markdown.finalize_markdown(value)
+    return misago.markdown.finalize_markdown(value)

+ 2 - 2
templates/cranefly/threads/changelog.html

@@ -1,7 +1,7 @@
 {% extends "cranefly/layout.html" %}
 {% extends "cranefly/layout.html" %}
 {% import "cranefly/macros.html" as macros with context %}
 {% import "cranefly/macros.html" as macros with context %}
 
 
-{% block title %}{{ macros.page_title(title=(_("Post #%(post)s Changelog", post=post.pk)),parent=thread.name) }}{% endblock %}
+{% block title %}{{ macros.page_title(title=(_("Post #%(post)s Changelog" % {'post': post.pk})),parent=thread.name) }}{% endblock %}
 
 
 {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
 {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
 {{ macros.parents_list(parents) }}
 {{ macros.parents_list(parents) }}
@@ -78,4 +78,4 @@
 
 
 {% macro edit_user(edit) -%}
 {% macro edit_user(edit) -%}
 {% if edit.user_id %}<a href="{{ url('user', user=edit.user_id, username=edit.user_slug) }}">{{ edit.user_name }}</a>{% else %}{{ edit.user_name }}{% endif %}
 {% if edit.user_id %}<a href="{{ url('user', user=edit.user_id, username=edit.user_slug) }}">{{ edit.user_name }}</a>{% else %}{{ edit.user_name }}{% endif %}
-{%- endmacro %}
+{%- endmacro %}

+ 1 - 1
templates/cranefly/threads/changelog_diff.html

@@ -1,7 +1,7 @@
 {% extends "cranefly/layout.html" %}
 {% extends "cranefly/layout.html" %}
 {% import "cranefly/macros.html" as macros with context %}
 {% import "cranefly/macros.html" as macros with context %}
 
 
-{% block title %}{{ macros.page_title(title=(_("Post #%(post)s Changelog", post=post.pk)),parent=thread.name) }}{% endblock %}
+{% block title %}{{ macros.page_title(title=(_("Post #%(post)s Changelog" % {'post': post.pk})),parent=thread.name) }}{% endblock %}
 
 
 {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
 {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
 {{ macros.parents_list(parents) }}
 {{ macros.parents_list(parents) }}