Use truncated_id in `be html` comment <div id="">
authorW. Trevor King <wking@drexel.edu>
Mon, 22 Feb 2010 14:39:21 +0000 (09:39 -0500)
committerW. Trevor King <wking@drexel.edu>
Mon, 22 Feb 2010 14:39:21 +0000 (09:39 -0500)
libbe/command/html.py

index 1148236b4c2d6bf9f38da56162150d7c86be8acd..d26faf8044042eea0235867856ae128b5ac51e1c 100644 (file)
@@ -243,14 +243,15 @@ class HTMLGen (object):
                 comment_entries.append('</div>\n')
             assert len(stack) == depth
             stack.append(comment)
+            template_info = {
+                'shortname': comment.id.user(),
+                'truncated_id': self._truncated_comment_id(comment)}
             if depth == 0:
                 comment_entries.append('<div class="comment root">')
             else:
                 comment_entries.append(
-                    '<div class="comment" id="%s">' % comment.uuid)
-            template_info = {
-                'shortname': comment.id.user(),
-                'truncated_id': self._truncated_comment_id(comment)}
+                    '<div class="comment" id="%s">'
+                    % template_info['truncated_id'])
             for attr in ['uuid', 'author', 'date', 'body']:
                 value = getattr(comment, attr)
                 if attr == 'body':