350 |
350 |
351 if len(comments) == 0 : #want to bypass html conversion in this case |
351 if len(comments) == 0 : #want to bypass html conversion in this case |
352 return content_export2(request, original_content, text_version.title, original_format, format, use_pandoc, download_response) |
352 return content_export2(request, original_content, text_version.title, original_format, format, use_pandoc, download_response) |
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 = text_version.get_content() |
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 marked_content = insert_comment_markers(wrapped_text_version, comments, with_markers, with_color) |
358 marked_content = insert_comment_markers(wrapped_text_version, comments, with_markers, with_color) |
359 |
359 |
360 viewable_comments = comments_thread(request, text_version, text) |
360 viewable_comments = comments_thread(request, text_version, text) |