diff --git a/components/blocks/code.js b/components/blocks/code.js index b02f5ef2d..e8efad6f7 100644 --- a/components/blocks/code.js +++ b/components/blocks/code.js @@ -60,6 +60,8 @@ const Code = ({ img, lines, hideCopyButton = false, + filename, + filenameOnly = true, }) => { // Create a ref for the code element. const codeRef = useRef(null); @@ -124,13 +126,15 @@ const Code = ({ // Extract language identifier for display const langId = languageClass?.substring(9) || language || "python"; const displayLanguage = languageDisplayNames[langId] || langId; - const showLanguage = langId.toLowerCase() !== "none"; + const showLanguage = + langId.toLowerCase() !== "none" && !(filenameOnly && filename); const Header = (