diff --git a/opentech/apply/activity/templates/activity/include/listing_base.html b/opentech/apply/activity/templates/activity/include/listing_base.html index b4fc73b953317d170ca442f8ef6870ec10a0afad..8f13bc06b68f315de7e3a96c9ffbdeb9f0d0fa6c 100644 --- a/opentech/apply/activity/templates/activity/include/listing_base.html +++ b/opentech/apply/activity/templates/activity/include/listing_base.html @@ -36,7 +36,7 @@ {% endif %} {% if editable %} - <div class="feed__comment js-comment" data-id="{{activity.id}}" data-comment="{{activity.message|to_markdown}}" data-edit-url="{% url 'funds:api:comments:edit' pk=activity.pk %}"> + <div class="feed__comment js-comment" data-id="{{activity.id}}" data-comment="{{activity|display_for:request.user|to_markdown}}" data-edit-url="{% url 'funds:api:comments:edit' pk=activity.pk %}"> {{ activity|display_for:request.user|submission_links|markdown|bleach }} </div> diff --git a/opentech/apply/funds/templatetags/markdown_tags.py b/opentech/apply/funds/templatetags/markdown_tags.py index a4e76e648ea66b7e1a3e6a788cc81c5be922b726..ac3320885ad5f07a38fbaa450b488b938a851d62 100644 --- a/opentech/apply/funds/templatetags/markdown_tags.py +++ b/opentech/apply/funds/templatetags/markdown_tags.py @@ -13,4 +13,7 @@ def markdown(value): @register.filter def to_markdown(value): + # pass through markdown to ensure comment is a + # fully formed HTML block + value = markdown(value) return tomd.convert(value)