File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ import { convertToHtmlSpans, hasAnsiEscapeCodes } from "../ansi-colors.ts";
150150import { ProjectContext } from "../../project/types.ts" ;
151151import { mergeConfigs } from "../config.ts" ;
152152import { encode as encodeBase64 } from "encoding/base64.ts" ;
153+ import { isIpynbOutput } from "../../config/format.ts" ;
153154
154155export const kQuartoMimeType = "quarto_mimetype" ;
155156export const kQuartoOutputOrder = "quarto_order" ;
@@ -1096,6 +1097,14 @@ async function mdFromCodeCell(
10961097 // write div enclosure
10971098 const divMd : string [ ] = [ `::: {` ] ;
10981099
1100+ // If we're targeting ipynb output, include the id in the
1101+ // markdown. This will cause the id to be included in the
1102+ // rendered notebook. Note that elsewhere we forard the
1103+ // label to the id, so that can appear as the cell id.
1104+ if ( isIpynbOutput ( options . executeOptions . format . pandoc ) && cell . id ) {
1105+ divMd . push ( `#${ cell . id } ` ) ;
1106+ }
1107+
10991108 // metadata to exclude from cell div attributes
11001109 const kCellOptionsFilter = kJupyterCellInternalOptionKeys . concat (
11011110 kJupyterCellStandardMetadataKeys ,
You can’t perform that action at this time.
0 commit comments