Adding this as a javascript extension on a template works as a workaround:
require(['xwiki-page-ready'], function(pageReady) { if (window.XWiki?.contextaction === 'export') { // ===== BEGIN PagedJS string-set quote patch ===== // Workaround for Paged.js 0.4.3 bug where string-set variables are emitted like: // --pagedjs-string-first-section-name: "Definitions; // instead of: // --pagedjs-string-first-section-name: "Definitions"; // // Do not directly require(['paged-polyfill']) here. XWiki.PDFExport.Sheet controls when // PagedJS is loaded. This wrapper only intercepts that later load. try { require.config({ map: { '*': { 'paged-polyfill': 'garney-paged-polyfill-patched' }, 'garney-paged-polyfill-patched': { 'paged-polyfill': 'paged-polyfill-patched' } } }); define('garney-paged-polyfill-patched', ['paged-polyfill'], function(PagedPolyfill) { if (!window.__garneyPagedStringSetPatchRegistered) { window.__garneyPagedStringSetPatchRegistered = true; class FixStringSetQuotes extends Paged.Handler { afterPageLayout(pageFragment) { console.log( 'afterPageLayout', pageFragment.id ); const style = pageFragment.style; // Copy property names first because CSSStyleDeclaration is live. const properties = []; for (let i = 0; i < style.length; i++) { properties.push(style[i]); } properties.forEach(function(property) { if (!property.startsWith('--pagedjs-string-')) { return; } const value = style.getPropertyValue(property).trim(); const quoteCount = (value.match(/"/g) || []).length; if (value.startsWith('"') && quoteCount % 2 === 1) { const fixed = value + '"'; style.setProperty(property, fixed); console.log('Fixed PagedJS string-set variable:', property, value, '=>', fixed); } }); } } Paged.registerHandlers(FixStringSetQuotes); console.log('PagedJS string-set quote patch registered.'); }