================
@@ -771,7 +787,31 @@ static void serializeInfo(const NamespaceInfo &I, 
json::Object &Obj,
     Obj["HasVariables"] = true;
   }
 
-  serializeCommonChildren(I.Children, Obj, RepositoryUrl, 
RepositoryLinePrefix);
+  if (Markdown) {
+    SmallString<64> BasePath = I.getRelativeFilePath("");
+    // serializeCommonChildren doesn't accept Infos, so this lambda needs to be
+    // created here. To avoid making serializeCommonChildren a template, this
+    // lambda is an std::function
+    ReferenceFunc SerializeMDReferenceLambda =
+        [BasePath](const Reference &Ref, Object &Object) {
+          serializeMDReference(Ref, Object, BasePath);
+        };
+    serializeCommonChildren(I.Children, Obj, RepositoryUrl,
+                            RepositoryLinePrefix, SerializeMDReferenceLambda);
+    if (!I.Children.Namespaces.empty()) {
+      serializeArray(I.Children.Namespaces, Obj, "Namespaces",
+                     SerializeMDReferenceLambda);
+      Obj["HasNamespaces"] = true;
+    }
----------------
ilovepi wrote:

This block looks common to both branches.

https://github.com/llvm/llvm-project/pull/177221
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to