From d6a65d79d9a4de724ea8fd8eccefbdceb6787853 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Wed, 10 Apr 2024 21:31:37 -0700 Subject: [PATCH] Handle literal source code content in metadata file --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.html b/index.html index 20066ea..91dde2f 100644 --- a/index.html +++ b/index.html @@ -300,6 +300,13 @@ // Fetch source code if (json?.sources !== undefined) { for (const [file, source] of Object.entries(json.sources)) { + // Source code is literal within the metadata file (i.e., compiler option "useLiteralContent: true") + if (source?.content !== undefined) { + const code = source.content; + logOutput(result, `✅ Successfully fetched source code for "${file}".`, code); + continue; + } + // Source code is linked within metadata file via IPFS try { const cidV0 = source.urls[1].substring(11); const code = await fetchCID(cidV0, ipfs).then(r => r.text()); -- 2.47.3