File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -193,12 +193,16 @@ export async function canonicalizeTitlePostprocessor(
193193 } ,
194194) : Promise < HtmlPostProcessResult > {
195195 // https://github.com/quarto-dev/quarto-cli/issues/10567
196+ // this fix cannot happen in `processDocumentTitle` because
197+ // that's too late in the postprocessing order
196198 const titleBlock = doc . querySelector ( "header.quarto-title-block" ) ;
197- if ( ! titleBlock ) {
198- const main = doc . querySelector ( "main" ) ;
199- if ( ! main ) {
200- throw new InternalError ( "No main element found in document" ) ;
201- }
199+
200+ const main = doc . querySelector ( "main" ) ;
201+ // if no main element exists, this is likely a revealjs presentation
202+ // which will generally have a title slide instead of a title block
203+ // so we don't need to do anything
204+
205+ if ( ! titleBlock && main ) {
202206 const header = doc . createElement ( "header" ) ;
203207 header . id = "title-block-header" ;
204208 header . classList . add ( "quarto-title-block" ) ;
You can’t perform that action at this time.
0 commit comments