diff --git a/components/PrismMac.js b/components/PrismMac.js index 687bf666..22fc3709 100644 --- a/components/PrismMac.js +++ b/components/PrismMac.js @@ -23,8 +23,8 @@ const PrismMac = () => { const observer = new MutationObserver(mutationsList => { for (const m of mutationsList) { if (m.target.nodeName === 'DETAILS') { - const preCode = m.target.querySelector('pre.notion-code') - if (preCode) { + const preCodes = m.target.querySelectorAll('pre.notion-code') + for (const preCode of preCodes) { Prism.plugins.lineNumbers.resize(preCode) } } diff --git a/components/WalineComponent.js b/components/WalineComponent.js index 09983f23..c3da56ab 100644 --- a/components/WalineComponent.js +++ b/components/WalineComponent.js @@ -62,8 +62,10 @@ const WalineComponent = (props) => { } return () => { - waline.destroy() - waline = null + if (waline) { + waline.destroy() + waline = null + } router.events.off('routeChangeComplete', updateWaline) } }, []) diff --git a/styles/notion.css b/styles/notion.css index adf92a8c..0f313528 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1978,4 +1978,10 @@ pre[class*='language-'] { .notion-asset-wrapper-pdf>div{ width:unset!important +} + +/* pdf预览适配页面 */ +.react-pdf__Page__canvas,.react-pdf__Page__textContent{ + width: 100% !important; + height: auto !important; } \ No newline at end of file diff --git a/themes/next/LayoutBase.js b/themes/next/LayoutBase.js index 3f0043a2..e178da0f 100644 --- a/themes/next/LayoutBase.js +++ b/themes/next/LayoutBase.js @@ -69,6 +69,7 @@ const LayoutBase = (props) => {