diff --git a/opentech/apply/funds/differ.py b/opentech/apply/funds/differ.py index 8b2c855fff626f8f7148f8ec4271463b3ae309fa..f99cb7f7b73c3b2c6594ac9c9c865494fad61fe0 100644 --- a/opentech/apply/funds/differ.py +++ b/opentech/apply/funds/differ.py @@ -29,16 +29,16 @@ def compare(answer_a, answer_b, should_bleach=True): if should_bleach: if isinstance(answer_a, str): - answer_a = bleach.clean(answer_a) + answer_a = bleach.clean(answer_a, tags=['section', 'h4', 'p', 'br'], attributes={}, strip=True) else: answer_a = str(answer_a) if isinstance(answer_b, str): - answer_b = bleach.clean(answer_b) + answer_b = bleach.clean(answer_b, tags=['section', 'h4', 'p', 'br'], attributes={}, strip=True) else: answer_b = str(answer_b) - diff = SequenceMatcher(lambda x: '\n' in x, answer_a, answer_b) + diff = SequenceMatcher(lambda x: '\n\r' in x, answer_a, answer_b) output = [] added = [] deleted = [] diff --git a/opentech/apply/funds/templates/funds/applicationrevision_list.html b/opentech/apply/funds/templates/funds/applicationrevision_list.html index d9dd2c55d6014b2f41cd9b3288851fa7c35287c9..e39d7b0f740250b5b59036c0a7aee4ca3f7285bf 100644 --- a/opentech/apply/funds/templates/funds/applicationrevision_list.html +++ b/opentech/apply/funds/templates/funds/applicationrevision_list.html @@ -14,7 +14,7 @@ {% for revision in object_list %} <li class="revision__item"> <p class="revision__meta"> - <span class="revision__date">{{ revision.timestamp|date:"m.d.y h:iA e"}} </span> + <span class="revision__date">{{ revision.timestamp|date:"Y-m-d H:i e"}} </span> by {{ revision.author }} {% if forloop.first %} <span class="revision__current">- current</span> diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index 11abacbb225ef32a07ce0c207de580674dd9762c..1d480247ecf9f5ca5f1856208acdea47d484ad65 100644 --- a/opentech/apply/funds/views.py +++ b/opentech/apply/funds/views.py @@ -809,7 +809,7 @@ class RevisionCompareView(DetailView): # Compare all the answers diffed_text_fields_answers = [ - compare(*fields, should_bleach=False) + compare(*fields, should_bleach=True) for fields in zip(from_rendered_text_fields, to_rendered_text_fields) ]