aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-03 15:35:12 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-03 15:42:11 +0100
commit9ac6745ae4257c8f73c2c5682e1ce74407e1d886 (patch)
tree6a571628cf40500a6f2f42bc22fc627f74194fde /mammoth
parent92b00aeb4c1d0ab49507cbd4ad9a25e30a1ac724 (diff)
Change formatting of comments to match Word
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/conversion.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/mammoth/conversion.py b/mammoth/conversion.py
index b40b0e2..d58fe6a 100644
--- a/mammoth/conversion.py
+++ b/mammoth/conversion.py
@@ -214,14 +214,14 @@ class _DocumentConverter(documents.ElementVisitor):
comment = self._comments[reference.comment_id]
self._comment_count_by_initials[comment.author_initials] += 1
count = self._comment_count_by_initials[comment.author_initials]
- label = "{0} {1}".format(_comment_author_label(comment), count)
+ label = "[{0}{1}]".format(_comment_author_label(comment), count)
self._referenced_comments.append((label, comment))
return [
# TODO: remove duplication with note references
html.element("a", {
"href": "#" + self._referent_html_id("comment", reference.comment_id),
"id": self._reference_html_id("comment", reference.comment_id),
- }, [html.text("[{0}]".format(label))])
+ }, [html.text(label)])
]
html_path = self._find_html_path(
@@ -244,7 +244,11 @@ class _DocumentConverter(documents.ElementVisitor):
])
]
return [
- html.element("dt", {"id": self._referent_html_id("comment", comment.comment_id)}, [html.text(label)]),
+ html.element(
+ "dt",
+ {"id": self._referent_html_id("comment", comment.comment_id)},
+ [html.text("Comment {0}".format(label))],
+ ),
html.element("dd", {}, body),
]