File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -1461,6 +1461,13 @@ const figCapInCalloutMarginProcessor: MarginNodeProcessor = {
14611461
14621462const kPreviewFigColumnForwarding = [ ".grid" ] ;
14631463
1464+ const isInsideAbout = ( el : Element ) =>
1465+ ! ! findParent (
1466+ el ,
1467+ ( parent ) =>
1468+ Array . from ( parent . classList ) . some ( ( x ) => x . startsWith ( "quarto-about-" ) ) ,
1469+ ) ;
1470+
14641471const processFigureOutputs = ( doc : Document ) => {
14651472 // For any non-margin figures, we want to actually place the figure itself
14661473 // into the column, and leave the caption as is, if possible
@@ -1497,13 +1504,19 @@ const processFigureOutputs = (doc: Document) => {
14971504
14981505 // If there is a single figure, then forward the column class onto that
14991506 const figures = columnEl . querySelectorAll ( "figure img.figure-img" ) ;
1500- if ( figures && figures . length === 1 ) {
1507+
1508+ if (
1509+ figures && figures . length === 1 && ! isInsideAbout ( figures [ 0 ] as Element )
1510+ ) {
15011511 moveColumnClasses ( columnEl , figures [ 0 ] as Element ) ;
15021512 } else {
15031513 const layoutFigures = columnEl . querySelectorAll (
15041514 ".quarto-layout-panel > figure.figure .quarto-layout-row" ,
15051515 ) ;
1506- if ( layoutFigures && layoutFigures . length === 1 ) {
1516+ if (
1517+ layoutFigures && layoutFigures . length === 1 &&
1518+ ! isInsideAbout ( layoutFigures [ 0 ] as Element )
1519+ ) {
15071520 moveColumnClasses ( columnEl , layoutFigures [ 0 ] as Element ) ;
15081521 }
15091522 }
You can’t perform that action at this time.
0 commit comments