Skip to content

Commit 63a3bfe

Browse files
committed
Fix constructer replacement.
1 parent 835bce9 commit 63a3bfe

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cppman/formatter/cppreference.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ def html2groff(data, name):
210210

211211
if idx:
212212
class_name = name
213+
if class_name.startswith('std::'):
214+
normalized_class_name = class_name[len('std::'):]
213215
class_member_content = data[:idx]
214216
secs = re.findall(r'\.SH "(.+?)"(.+?)\.SE', class_member_content, re.S)
215217

@@ -222,10 +224,10 @@ def html2groff(data, name):
222224
content2 = re.sub(r'\n\.IP "([^:]+?)"', r'\n.IP "%s::\1"'
223225
% class_name, content)
224226
# Replace (constructor) (destructor)
225-
content2 = re.sub(r'\(constructor\)', r'%s' % class_name,
226-
content2)
227-
content2 = re.sub(r'\(destructor\)', r'~%s' % class_name,
228-
content2)
227+
content2 = re.sub(r'\(constructor\)', r'%s' %
228+
normalized_class_name, content2)
229+
content2 = re.sub(r'\(destructor\)', r'~%s' %
230+
normalized_class_name, content2)
229231
data = data.replace(content, content2)
230232

231233
blocks = re.findall(r'\.IBEGIN\s*(.+?)\s*\n(.+?)\.IEND', data, re.S)

0 commit comments

Comments
 (0)