src/cm/views/texts.py
changeset 450 81fa74c112b8
parent 443 cacd524f5279
child 453 1d314f629611
equal deleted inserted replaced
449:5387c032df35 450:81fa74c112b8
   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"&lt;", '<', wrapped_text_version)
       
   363         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)
   364     
   359     
   365         viewable_comments = comments_thread(request, text_version, text) 
   360         viewable_comments = comments_thread(request, text_version, text) 
   366     #        viewable_commentsnoreply = get_viewable_comments(request, commentsnoreply, text, order_by = ('start_wrapper','start_offset','end_wrapper','end_offset'))
   361     #        viewable_commentsnoreply = get_viewable_comments(request, commentsnoreply, text, order_by = ('start_wrapper','start_offset','end_wrapper','end_offset'))
   367     #        viewable_comments = []
   362     #        viewable_comments = []