File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,11 +19,23 @@ import { wordWrap } from "./annotations/word-wrap";
1919export async function Code ( { codeblock } : { codeblock : RawCode } ) {
2020 const highlighted = await highlight ( codeblock , "min-dark" ) ;
2121
22+ // Extract the filename/title from meta value, handling cases with docci commands
23+ const displayMeta = highlighted . meta ? ( ( ) => {
24+ // Split by spaces to handle both formats:
25+ // "docci-ignore filename" or "filename docci-ignore"
26+ const parts = highlighted . meta . split ( ' ' ) ;
27+
28+ // Find the part that doesn't start with 'docci'
29+ const title = parts . find ( part => ! part . startsWith ( 'docci' ) ) ;
30+
31+ return title || null ;
32+ } ) ( ) : null ;
33+
2234 return (
2335 < div className = "border rounded relative" >
24- { highlighted . meta && (
36+ { displayMeta && (
2537 < div className = "text-center text-zinc-400 text-sm min-h-[2rem] flex items-center justify-center" >
26- { highlighted . meta }
38+ { displayMeta }
2739 </ div >
2840) }
2941 < Pre
You can’t perform that action at this time.
0 commit comments