diff --git a/clang-tools-extra/clang-doc/assets/class-template.mustache b/clang-tools-extra/clang-doc/assets/class-template.mustache
index 8eb28f33e65f6..c5187026a2399 100644
--- a/clang-tools-extra/clang-doc/assets/class-template.mustache
+++ b/clang-tools-extra/clang-doc/assets/class-template.mustache
@@ -50,18 +50,21 @@
-
- {{#PublicMembers}}
-
- {{/PublicMembers}}
-
+
+
+ {{#PublicMembers}}
+
+ {{/PublicMembers}}
+
+
{{/HasPublicMembers}}
{{#ProtectedMembers}}
-
+
+
+
{{/ProtectedMembers}}
{{#HasPublicFunctions}}
-
- {{#PublicFunctions}}
-
- {{/PublicFunctions}}
-
+
+
+ {{#PublicFunctions}}
+
+ {{/PublicFunctions}}
+
+
{{/HasPublicFunctions}}
{{#ProtectedFunction}}
-
- {{#Obj}}
-
- {{/Obj}}
-
+
+
+ {{#Obj}}
+
+ {{/Obj}}
+
+
{{/ProtectedFunction}}
{{#Enums}}
-
- {{#Obj}}
-
- {{/Obj}}
-
+
+
+ {{#Obj}}
+
+ {{/Obj}}
+
+
{{/Enums}}
{{#Typedef}}
@@ -113,13 +123,15 @@
-
- {{#Links}}
-
- {{/Links}}
-
+
+
+ {{#Links}}
+
+ {{/Links}}
+
+
{{/Record}}
diff --git a/clang-tools-extra/clang-doc/assets/namespace-template.mustache b/clang-tools-extra/clang-doc/assets/namespace-template.mustache
index 614023b9f6723..8a5be46aee28b 100644
--- a/clang-tools-extra/clang-doc/assets/namespace-template.mustache
+++ b/clang-tools-extra/clang-doc/assets/namespace-template.mustache
@@ -50,25 +50,29 @@
-
- {{#Enums}}
-
- {{/Enums}}
-
+
+
+ {{#Enums}}
+
+ {{/Enums}}
+
+
{{/HasEnums}}
{{#HasRecords}}
-
- {{#Records}}
-
- {{/Records}}
-
+
+
+ {{#Records}}
+
+ {{/Records}}
+
+
{{/HasRecrods}}
diff --git a/clang-tools-extra/test/clang-doc/mustache-index.cpp b/clang-tools-extra/test/clang-doc/mustache-index.cpp
index 7b98c6b7c9880..19e0b32d3d4af 100644
--- a/clang-tools-extra/test/clang-doc/mustache-index.cpp
+++ b/clang-tools-extra/test/clang-doc/mustache-index.cpp
@@ -13,19 +13,21 @@ class Foo;
// CHECK:
-// CHECK-NEXT:
-// CHECK-NEXT:
-// CHECK-NEXT:
+// CHECK-NEXT:
+// CHECK-NEXT:
+// CHECK-NEXT:
+// CHECK-NEXT:
// CHECK:
-// CHECK-NEXT:
-// CHECK-NEXT:
-// CHECK-NEXT:
+// CHECK-NEXT:
+// CHECK-NEXT:
+// CHECK-NEXT:
+// CHECK-NEXT:
// CHECK:
// CHECK-NEXT: Enumerations