353 else : # case comments to be added |
353 else : # case comments to be added |
354 #comments = comments.order_by('start_wrapper','start_offset','end_wrapper','end_offset') |
354 #comments = comments.order_by('start_wrapper','start_offset','end_wrapper','end_offset') |
355 html = pandoc_convert(original_content, original_format, 'html') |
355 html = pandoc_convert(original_content, original_format, 'html') |
356 wrapped_text_version, _ , _ = spannify(html) |
356 wrapped_text_version, _ , _ = spannify(html) |
357 with_markers = True |
357 with_markers = True |
|
358 # Tidy has introduced HTML entities, which should be expanded to keep correct offsets of comments. |
|
359 wrapped_text_version =re.sub(r""", '"', wrapped_text_version) |
|
360 wrapped_text_version =re.sub(r"&", '&', wrapped_text_version) |
|
361 wrapped_text_version =re.sub(r">", '>', wrapped_text_version) |
|
362 wrapped_text_version =re.sub(r"<", '<', wrapped_text_version) |
358 marked_content = insert_comment_markers(wrapped_text_version, comments, with_markers, with_color) |
363 marked_content = insert_comment_markers(wrapped_text_version, comments, with_markers, with_color) |
359 |
364 |
360 viewable_comments = comments_thread(request, text_version, text) |
365 viewable_comments = comments_thread(request, text_version, text) |
361 # viewable_commentsnoreply = get_viewable_comments(request, commentsnoreply, text, order_by = ('start_wrapper','start_offset','end_wrapper','end_offset')) |
366 # viewable_commentsnoreply = get_viewable_comments(request, commentsnoreply, text, order_by = ('start_wrapper','start_offset','end_wrapper','end_offset')) |
362 # viewable_comments = [] |
367 # viewable_comments = [] |