From 0eaf186bf33536dcc81c6c83812eec53713e1394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Mon, 11 May 2020 22:27:37 +0200 Subject: [PATCH] Find out reveal.js path based on stylesheet because since ES6 modules there may be no reveal.js script elements anymore --- pdfexport.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pdfexport.js b/pdfexport.js index bd68cc5..fa91cbc 100644 --- a/pdfexport.js +++ b/pdfexport.js @@ -5,15 +5,15 @@ var PdfExport = ( function( _Reveal ){ var installAltKeyBindings = null; function getRevealJsPath(){ - var regex = /\bjs\/reveal.js$/i; - var script = Array.from( document.querySelectorAll( 'script' ) ).find( function( e ){ - return e.attributes.src && e.attributes.src.value.search( regex ) >= 0; + var regex = /\b[^/]+\/reveal.css$/i; + var script = Array.from( document.querySelectorAll( 'link' ) ).find( function( e ){ + return e.attributes.href && e.attributes.href.value.search( regex ) >= 0; }); if( !script ){ - console.error( 'reveal.js script could not be found in included