diff --git a/dist/lite/markedit-preview.js b/dist/lite/markedit-preview.js
index 96cfa29..3963c0c 100644
--- a/dist/lite/markedit-preview.js
+++ b/dist/lite/markedit-preview.js
@@ -1861,7 +1861,7 @@ ${e}
}
`,Qn=document.body,mn=document.createElement("div"),X=document.createElement("div"),Br=hn("* { cursor: col-resize }",!1),eo=mo.Annotation.define();var be=(e=>(e[e.edit=0]="edit",e[e.sideBySide=1]="sideBySide",e[e.preview=2]="preview",e))(be||{});function Zl(){hn(Vl),hn(Vt()),hn(Zt());const e=document.createElement("div");e.className=Be.dividerViewClass,mn.appendChild(e),mn.className=Be.gutterViewClass,Qn.appendChild(mn),X.className=Be.previewPaneClass,Qn.appendChild(X),document.addEventListener("keydown",r=>{if(!r.metaKey||r.key!=="a")return;const o=H.MarkEdit.editorView?.contentDOM??document.querySelector(".cm-content");(X.classList.contains("overlay")||document.activeElement!==o)&&(xo(X),r.preventDefault())}),new MutationObserver(qr).observe(X,{attributes:!0,attributeFilter:["style","class"]}),matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{qr(),document.querySelector(".mermaid")!==null&&Xn()}),typeof H.MarkEdit.getFileInfo=="function"&&typeof H.MarkEdit.openFile=="function"&&X.addEventListener("click",u0),X.addEventListener("click",r0)}function lu(e,n=!0){const u=de();dn.viewMode=e,e!==u&&localStorage.setItem(cu.viewModeCacheKey,String(e));const r=H.MarkEdit.editorView;e===0?r.focus():e===2&&r.contentDOM.blur(),e===1?(Qn.classList.add(Be.containerClass),dn.splitter??=Gl({columnGutters:[{track:1,element:mn}],minSize:150,onDragStart:()=>Br.disabled=!1,onDragEnd:()=>Br.disabled=!0})):(Qn.classList.remove(Be.containerClass),dn.splitter?.destroy(),dn.splitter=void 0),e===2?X.classList.add("overlay"):X.classList.remove("overlay"),n&&Xn()}function Wl(){const e=[0,...Kc.map(r=>{switch(r){case"side-by-side":return 1;case"preview":return 2;default:return}}).filter(r=>r!==void 0)],n=e.indexOf(de()),u=n===-1?0:(n+1)%e.length;lu(e[u])}function Yl(){const e=localStorage.getItem(cu.viewModeCacheKey);if(e===null)return;const n=Number(e);de()!==n&&lu(n,!0)}function de(){return dn.viewMode}async function Xn(){if(de()===0)return;const e=Kt(await su());X.innerHTML=e,Wt(()=>{zu(no(),Mn(),!1);const n=localStorage.getItem(cu.previewPageZoomKey);n!==null&&(X.style.zoom=n)})}function Kl(e){if(de()===0||de()===1&&H.MarkEdit.editorView.hasFocus||!e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;const n=Number(X.style.zoom)||1,u=r=>String(Math.min(Math.max(r,.5),3));switch(e.key){case"-":X.style.zoom=u(n-.1);break;case"=":X.style.zoom=u(n+.1);break;case"0":X.style.zoom="1";break;default:return}localStorage.setItem(cu.previewPageZoomKey,X.style.zoom),e.preventDefault(),e.stopPropagation()}function Jl(){ro(!1)}function Ql(){ro(!0)}async function Xl(){const e=await su(!1);await navigator.clipboard.writeText(e)}async function e0(){const e=await su(!1),n=new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([X.innerText],{type:"text/plain"})});await navigator.clipboard.write([n])}function no(){return H.MarkEdit.editorView.scrollDOM}function Mn(){return X}async function uo(e){const n=await su(!1);return e?await Yt(n):`
${n}`}async function n0(e,n){const u=await rr(e,!1);return n?await Yt(u):`
-${u}`}async function su(e=!0){const n=H.MarkEdit.editorAPI.getText();return await rr(n,e)}function qr(){const e=getComputedStyle(X).backgroundColor;mn.style.background=`linear-gradient(to right, transparent 50%, ${e} 50%)`}async function ro(e){const n=await(async()=>{const r=await H.MarkEdit.getFileInfo();return r===void 0?`${V("untitled")}.html`:`${ko(r.filePath)}.html`})(),u=await uo(e);H.MarkEdit.showSavePanel({fileName:n,string:u})}async function u0(e){if(!(e.target instanceof Element))return;const n=e.target.closest("a");if(n===null)return;const u=n.getAttribute("href");if(!u?.startsWith("../"))return;const r=(await H.MarkEdit.getFileInfo())?.parentPath;if(r!==void 0){e.preventDefault(),e.stopPropagation();try{const o=We(r,decodeURIComponent(u));await H.MarkEdit.openFile(o)}catch(o){console.error("Failed to open file:",o)}}}function r0(e){const n=e.target;if(!(n instanceof HTMLInputElement)||!n.classList.contains("task-list-item-checkbox"))return;const u=n.closest("[data-line-from]");if(u===null){console.error("Failed to find task item block");return}const r=H.MarkEdit.editorAPI,o=r.getLineRange(Ke(u).from),a=zl(r.getText(o));if(a===null){n.checked=!n.checked,console.error("Failed to resolve task toggle");return}const c=o.from+a.offset;H.MarkEdit.editorView.dispatch({changes:{from:c,to:c+1,insert:a.replacement},annotations:eo.of(!0)})}const dn={viewMode:0,splitter:void 0};async function Bu(){if(pn==="never")return;const e=await to();typeof e.tag_name=="string"&&e.name!=="1.8.0"&&(ao().has(e.name)||(pn==="automatic"&&$u()?await ir(e.tag_name):pn==="quiet"?(qu.pendingRelease=e,oo(e)):o0(e)))}async function t0(){const e=Date.now(),n=Number(localStorage.getItem(un.lastCheckCacheKey)??"0");if(!(e-n<2592e5))try{await Bu(),localStorage.setItem(un.lastCheckCacheKey,String(e))}catch(u){console.error("Failed to check for updates:",u)}}async function to(){return await(await fetch(un.latestReleaseURL)).json()}async function ir(e){if(typeof __FILE_PATH__!="string")return console.error("Cannot download the latest build: unknown file path"),!1;try{const n=__FILE_PATH__,u="lite/",r=e===void 0?"main":`refs/tags/${encodeURIComponent(e)}`,o=`${un.rawBaseURL}${r}/dist/${u}markedit-preview.js`,a=await fetch(o);if(!a.ok)return console.error(`Failed to download the latest build from ${o}`),!1;const c=await a.text();return await H.MarkEdit.createFile({path:n,string:c,overwrites:!0})}catch(n){return console.error("Failed to download the latest build:",n),!1}}function oo(e=qu.pendingRelease){if(e===void 0)return;const n=document.querySelector(`.${Be.updatePillClass}`);if(n!==null){if(n.dataset.releaseName===e.name)return n;n.remove()}const u=document.createElement("button");return u.dataset.releaseName=e.name,u.className=Be.updatePillClass,u.textContent=V("update"),u.style.display=de()===be.edit?"none":"",u.addEventListener("webkitmouseforcedown",r=>{r.preventDefault()}),u.addEventListener("click",()=>{const{title:r,actions:o}=io(e,()=>{qu.pendingRelease=void 0,u.remove()}),[a,...c]=o,i=u.getBoundingClientRect(),s={x:i.left,y:i.bottom+10};H.MarkEdit.showContextMenu([{title:r},a,{separator:!0},...c],s)}),document.body.appendChild(u),u}async function o0(e){const{title:n,actions:u}=io(e),r=await H.MarkEdit.showAlert({title:n,message:e.body,buttons:u.map(o=>o.title)});u[r]?.action?.()}function io(e,n=()=>{}){const u=`MarkEdit-preview ${e.name} ${V("newVersionAvailable")}`,r=[...$u()?[{title:V("updateAndRelaunch"),action:async()=>{await ir(e.tag_name)?H.MarkEdit.relaunchApp():H.MarkEdit.showAlert(V("failedToUpdate")),n()}}]:[],{title:V("viewReleasePage"),action:()=>{open(e.html_url),n()}},{title:V("remindMeLater"),action:n},{title:V("skipThisVersion"),action:()=>{const o=ao();o.add(e.name),localStorage.setItem(un.skippedCacheKey,JSON.stringify([...o])),n()}}];return{title:u,actions:r}}function ao(){const e=localStorage.getItem(un.skippedCacheKey);return new Set(JSON.parse(e??"[]"))}const un={latestReleaseURL:"https://api.github.com/repos/MarkEdit-app/MarkEdit-preview/releases/latest",rawBaseURL:"https://raw.githubusercontent.com/MarkEdit-app/MarkEdit-preview/",lastCheckCacheKey:"updater.last-check-time",skippedCacheKey:"updater.skipped-versions"},qu={pendingRelease:void 0},ju="markedit-preview",jr=`${ju}.js`;function i0(e){const{destExists:n,bundleInfo:u,currentVersion:r}=e,o=u?.version===r,a=u?.fullBuild===!1;return!(n&&o&&a)}async function a0(){try{const e=H.MarkEdit.getDirectoryPath("documents"),n=H.MarkEdit.getDirectoryPath("sharedContainer");if(e===void 0||n===void 0){console.error("Required directories are not accessible");return}const u=typeof __FILE_PATH__=="string"?__FILE_PATH__:We(e,`scripts/${jr}`);if(await H.MarkEdit.getFileInfo(u)===void 0){console.error(`Source file not found at ${u}`);return}const o=u.split("/").pop()??jr,a=We(n,"Shared/scripts"),c=We(a,o),i=await H.MarkEdit.getFileInfo(c)!==void 0,s=We(n,"Shared/metadata.json"),f=await vo(s),b=f[ju];if(!i0({destExists:i,bundleInfo:b,currentVersion:"1.8.0"}))return;const l=await H.MarkEdit.getFileContent(u);if(l===void 0){console.error(`Failed to read content from ${u}`);return}await H.MarkEdit.createFile({path:a,isDirectory:!0}),await H.MarkEdit.createFile({path:c,string:l,overwrites:!0}),await H.MarkEdit.createFile({path:s,string:JSON.stringify({...f,[ju]:{version:"1.8.0",fullBuild:!1}},null,2),overwrites:!0})}catch(e){console.error("Failed to copy the current file to shared container:",e)}}function c0(){const e=Hr(V("source")),n=Hr(V("preview")),u=document.createElement("div");u.className="quicklook-segmented",u.setAttribute("role","tablist"),u.append(e,n);const r=document.createElement("div");return r.className="quicklook-toolbar",r.appendChild(u),{toolbar:r,sourceButton:e,previewButton:n}}function Hr(e){const n=document.createElement("button");return n.textContent=e,n.type="button",n.className="quicklook-segment",n.setAttribute("role","tab"),n}function Ve(){if(Ze!==void 0)return Ze;try{Ze=localStorage.getItem(co)==="preview"?"preview":"source"}catch{console.error("Failed to read quick look mode from localStorage"),Ze="source"}return Ze}function $r(e){Ze=e;try{localStorage.setItem(co,e)}catch{console.error("Failed to write quick look mode to localStorage")}}let Ze;const co="ui.quicklook-mode";function l0(){const e=window,n=e.editor?.state?.doc.toString();return typeof n=="string"?n:(console.error("Failed to get text from host editor state"),e.config?.text??"")}function s0(){document.addEventListener("webkitmouseforcewillbegin",e=>{const n=e.target;n instanceof Element&&n.closest("a")!==null&&e.preventDefault()})}function d0(e,n){const u=window,r=u.pinchZoomTarget;u.pinchZoomTarget=()=>{if(e()!=="preview")return r?.()??null;const o=n.querySelector(".quicklook-content");return o!==null?{scroller:n,inner:o}:null}}function f0(e,n){let u;const r=window,o={start:r.startDragging,update:r.updateDragging,cancel:r.cancelDragging},a=()=>{const i=n.clientHeight,s=n.scrollHeight,f=s-i;if(f<=0||s<=0)return{clientHeight:i,scrollHeight:s,scrollbarHeight:i,scrollbarTop:0};const b=i*(i/s),d=n.scrollTop/f*(i-b);return{clientHeight:i,scrollHeight:s,scrollbarHeight:b,scrollbarTop:d}},c=(i,s,f="auto")=>{const{clientHeight:b,scrollHeight:l,scrollbarHeight:d}=a(),h=b-d;if(h>0){const m=(i-s)/h;n.scrollTo({top:m*(l-b),behavior:f})}};r.startDragging=i=>{if(e()!=="preview"){o.start?.(i);return}const{scrollbarTop:s,scrollbarHeight:f}=a(),b=Ur(n,i);u=b-s,(bs+f)&&c(b,f*.5,"smooth")},r.updateDragging=i=>{if(e()!=="preview"){o.update?.(i);return}u!==void 0&&c(Ur(n,i),u)},r.cancelDragging=()=>{if(e()!=="preview"){o.cancel?.();return}u=void 0}}function h0(e,n,u){u.addEventListener("wheel",r=>{const o=e()==="preview"?n:document.querySelector(".cm-scroller");o!==null&&(o.scrollTop+=r.deltaY,o.scrollLeft+=r.deltaX,r.preventDefault())},{passive:!1})}function p0(e,n,u){const r=document.querySelector(".cm-scroller"),o=()=>{const c=(e()==="preview"?n:r)?.scrollTop??0;u.classList.toggle("scrolled",c>0),u.classList.toggle("scrolled-far",c>20)};return n.addEventListener("scroll",o,{passive:!0}),r?.addEventListener("scroll",o,{passive:!0}),o}function Ur(e,n){return n-e.getBoundingClientRect().top}const b0=`body {
+${u}`}async function su(e=!0){const n=H.MarkEdit.editorAPI.getText();return await rr(n,e)}function qr(){const e=getComputedStyle(X).backgroundColor;mn.style.background=`linear-gradient(to right, transparent 50%, ${e} 50%)`}async function ro(e){const n=await(async()=>{const r=await H.MarkEdit.getFileInfo();return r===void 0?`${V("untitled")}.html`:`${ko(r.filePath)}.html`})(),u=await uo(e);H.MarkEdit.showSavePanel({fileName:n,string:u})}async function u0(e){if(!(e.target instanceof Element))return;const n=e.target.closest("a");if(n===null)return;const u=n.getAttribute("href");if(!u?.startsWith("../"))return;const r=(await H.MarkEdit.getFileInfo())?.parentPath;if(r!==void 0){e.preventDefault(),e.stopPropagation();try{const o=We(r,decodeURIComponent(u));await H.MarkEdit.openFile(o)}catch(o){console.error("Failed to open file:",o)}}}function r0(e){const n=e.target;if(!(n instanceof HTMLInputElement)||!n.classList.contains("task-list-item-checkbox"))return;const u=n.closest("[data-line-from]");if(u===null){console.error("Failed to find task item block");return}const r=H.MarkEdit.editorAPI,o=r.getLineRange(Ke(u).from),a=zl(r.getText(o));if(a===null){n.checked=!n.checked,console.error("Failed to resolve task toggle");return}const c=o.from+a.offset;H.MarkEdit.editorView.dispatch({changes:{from:c,to:c+1,insert:a.replacement},annotations:eo.of(!0)})}const dn={viewMode:0,splitter:void 0};async function Bu(){if(pn==="never")return;const e=await to();typeof e.tag_name=="string"&&e.name!=="1.8.0"&&(ao().has(e.name)||(pn==="automatic"&&$u()?await ir(e.tag_name):pn==="quiet"?(qu.pendingRelease=e,oo(e)):o0(e)))}async function t0(){const e=Date.now(),n=Number(localStorage.getItem(un.lastCheckCacheKey)??"0");if(!(e-n<2592e5))try{await Bu(),localStorage.setItem(un.lastCheckCacheKey,String(e))}catch(u){console.error("Failed to check for updates:",u)}}async function to(){return await(await fetch(un.latestReleaseURL)).json()}async function ir(e){if(typeof __FILE_PATH__!="string")return console.error("Cannot download the latest build: unknown file path"),!1;try{const n=__FILE_PATH__,u="lite/",r=e===void 0?"main":`refs/tags/${encodeURIComponent(e)}`,o=`${un.rawBaseURL}${r}/dist/${u}markedit-preview.js`,a=await fetch(o);if(!a.ok)return console.error(`Failed to download the latest build from ${o}`),!1;const c=await a.text();return await H.MarkEdit.createFile({path:n,string:c,overwrites:!0})}catch(n){return console.error("Failed to download the latest build:",n),!1}}function oo(e=qu.pendingRelease){if(e===void 0)return;const n=document.querySelector(`.${Be.updatePillClass}`);if(n!==null){if(n.dataset.releaseName===e.name)return n;n.remove()}const u=document.createElement("button");return u.dataset.releaseName=e.name,u.className=Be.updatePillClass,u.textContent=V("update"),u.style.display=de()===be.edit?"none":"",u.addEventListener("webkitmouseforcedown",r=>{r.preventDefault()}),u.addEventListener("click",()=>{const{title:r,actions:o}=io(e,()=>{qu.pendingRelease=void 0,u.remove()}),[a,...c]=o,i=u.getBoundingClientRect(),s={x:i.left,y:i.bottom+10};H.MarkEdit.showContextMenu([{title:r},a,{separator:!0},...c],s)}),document.body.appendChild(u),u}async function o0(e){const{title:n,actions:u}=io(e),r=await H.MarkEdit.showAlert({title:n,message:e.body,buttons:u.map(o=>o.title)});u[r]?.action?.()}function io(e,n=()=>{}){const u=`MarkEdit-preview ${e.name} ${V("newVersionAvailable")}`,r=[...$u()?[{title:V("updateAndRelaunch"),action:async()=>{await ir(e.tag_name)?H.MarkEdit.relaunchApp():H.MarkEdit.showAlert(V("failedToUpdate")),n()}}]:[],{title:V("viewReleasePage"),action:()=>{open(e.html_url),n()}},{title:V("remindMeLater"),action:n},{title:V("skipThisVersion"),action:()=>{const o=ao();o.add(e.name),localStorage.setItem(un.skippedCacheKey,JSON.stringify([...o])),n()}}];return{title:u,actions:r}}function ao(){const e=localStorage.getItem(un.skippedCacheKey);return new Set(JSON.parse(e??"[]"))}const un={latestReleaseURL:"https://api.github.com/repos/MarkEdit-app/MarkEdit-preview/releases/latest",rawBaseURL:"https://raw.githubusercontent.com/MarkEdit-app/MarkEdit-preview/",lastCheckCacheKey:"updater.last-check-time",skippedCacheKey:"updater.skipped-versions"},qu={pendingRelease:void 0},ju="markedit-preview",jr=`${ju}.js`;function i0(e){const{destExists:n,bundleInfo:u,currentVersion:r}=e,o=u?.version===r,a=u?.fullBuild===!1;return!(n&&o&&a)}async function a0(){try{const e=H.MarkEdit.getDirectoryPath("documents"),n=H.MarkEdit.getDirectoryPath("sharedContainer");if(e===void 0||n===void 0){console.error("Required directories are not accessible");return}const u=typeof __FILE_PATH__=="string"?__FILE_PATH__:We(e,`scripts/${jr}`);if(await H.MarkEdit.getFileInfo(u)===void 0){console.error(`Source file not found at ${u}`);return}const o=u.split("/").pop()??jr,a=We(n,"Shared/scripts"),c=We(a,o),i=await H.MarkEdit.getFileInfo(c)!==void 0,s=We(n,"Shared/metadata.json"),f=await vo(s),b=f[ju];if(!i0({destExists:i,bundleInfo:b,currentVersion:"1.8.0"}))return;const l=await H.MarkEdit.getFileContent(u);if(l===void 0){console.error(`Failed to read content from ${u}`);return}await H.MarkEdit.createFile({path:a,isDirectory:!0}),await H.MarkEdit.createFile({path:c,string:l,overwrites:!0}),await H.MarkEdit.createFile({path:s,string:JSON.stringify({...f,[ju]:{version:"1.8.0",fullBuild:!1}},null,2),overwrites:!0})}catch(e){console.error("Failed to copy the current file to shared container:",e)}}function c0(){const e=Hr(V("source")),n=Hr(V("preview")),u=document.createElement("div");u.className="quicklook-segmented",u.setAttribute("role","tablist"),u.append(e,n);const r=document.createElement("div");return r.className="quicklook-toolbar",r.appendChild(u),{toolbar:r,sourceButton:e,previewButton:n}}function Hr(e){const n=document.createElement("button");return n.textContent=e,n.type="button",n.className="quicklook-segment",n.setAttribute("role","tab"),n}function Ve(){if(Ze!==void 0)return Ze;try{Ze=localStorage.getItem(co)==="preview"?"preview":"source"}catch{console.error("Failed to read quick look mode from localStorage"),Ze="source"}return Ze}function $r(e){Ze=e;try{localStorage.setItem(co,e)}catch{console.error("Failed to write quick look mode to localStorage")}}let Ze;const co="ui.quicklook-mode";function l0(){const e=window,n=e.editor?.state?.doc.toString();return typeof n=="string"?n:(console.error("Failed to get text from host editor state"),e.config?.text??"")}function s0(){document.addEventListener("webkitmouseforcewillbegin",e=>{const n=e.target;n instanceof Element&&n.closest("a")!==null&&e.preventDefault()})}function d0(e,n){const u=window,r=u.pinchZoomTarget;u.pinchZoomTarget=()=>{if(e()!=="preview")return r?.()??null;const o=n.querySelector(".quicklook-content");return o!==null?{scroller:n,inner:o}:null};for(const o of["gesturechange","gestureend"])document.addEventListener(o,()=>{if(e()!=="preview")return;const a=n.querySelector(".quicklook-content");a?.style.setProperty("--quicklook-zoom",a.style.zoom||"0.9")},{passive:!1})}function f0(e,n){let u;const r=window,o={start:r.startDragging,update:r.updateDragging,cancel:r.cancelDragging},a=()=>{const i=n.clientHeight,s=n.scrollHeight,f=s-i;if(f<=0||s<=0)return{clientHeight:i,scrollHeight:s,scrollbarHeight:i,scrollbarTop:0};const b=i*(i/s),d=n.scrollTop/f*(i-b);return{clientHeight:i,scrollHeight:s,scrollbarHeight:b,scrollbarTop:d}},c=(i,s,f="auto")=>{const{clientHeight:b,scrollHeight:l,scrollbarHeight:d}=a(),h=b-d;if(h>0){const m=(i-s)/h;n.scrollTo({top:m*(l-b),behavior:f})}};r.startDragging=i=>{if(e()!=="preview"){o.start?.(i);return}const{scrollbarTop:s,scrollbarHeight:f}=a(),b=Ur(n,i);u=b-s,(bs+f)&&c(b,f*.5,"smooth")},r.updateDragging=i=>{if(e()!=="preview"){o.update?.(i);return}u!==void 0&&c(Ur(n,i),u)},r.cancelDragging=()=>{if(e()!=="preview"){o.cancel?.();return}u=void 0}}function h0(e,n,u){u.addEventListener("wheel",r=>{const o=e()==="preview"?n:document.querySelector(".cm-scroller");o!==null&&(o.scrollTop+=r.deltaY,o.scrollLeft+=r.deltaX,r.preventDefault())},{passive:!1})}function p0(e,n,u){const r=document.querySelector(".cm-scroller"),o=()=>{const c=(e()==="preview"?n:r)?.scrollTop??0;u.classList.toggle("scrolled",c>0),u.classList.toggle("scrolled-far",c>20)};return n.addEventListener("scroll",o,{passive:!0}),r?.addEventListener("scroll",o,{passive:!0}),o}function Ur(e,n){return n-e.getBoundingClientRect().top}const b0=`body {
--editor-inset-top: 34px;
}
@@ -1875,9 +1875,9 @@ ${u}`}async function su(e=!0){const n=H.MarkEdit.editorAPI.getText();return awai
zoom: 0.9;
/* Pull content under the toolbar (scroller stays inset to keep its scrollbar clear) */
- margin-top: calc(-1 * var(--editor-inset-top) / 0.9) !important;
+ margin-top: calc(-1 * var(--editor-inset-top) * 0.9 / var(--quicklook-zoom, 0.9)) !important;
/* Restore the height the negative margin removed so bouncing stays in the pane, not the page */
- min-height: calc(100% + var(--editor-inset-top) / 0.9 + 1px);
+ min-height: calc(100% + var(--editor-inset-top) + 1px);
}
/* Links are not interactive in quicklook */
diff --git a/dist/markedit-preview.js b/dist/markedit-preview.js
index fe2e78e..a55b9a0 100644
--- a/dist/markedit-preview.js
+++ b/dist/markedit-preview.js
@@ -2112,7 +2112,7 @@ ${t}
display: none !important;
}`);const t=document.createElement("div");t.className=cp.dividerViewClass,zE.appendChild(t),zE.className=cp.gutterViewClass,hC.appendChild(zE),Ea.className=cp.previewPaneClass,hC.appendChild(Ea),document.addEventListener("keydown",n=>{if(!n.metaKey||n.key!=="a")return;const i=Yr.MarkEdit.editorView?.contentDOM??document.querySelector(".cm-content");(Ea.classList.contains("overlay")||document.activeElement!==i)&&(aNe(Ea),n.preventDefault())}),new MutationObserver(wK).observe(Ea,{attributes:!0,attributeFilter:["style","class"]}),matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{wK(),document.querySelector(".mermaid")!==null&&fC()}),typeof Yr.MarkEdit.getFileInfo=="function"&&typeof Yr.MarkEdit.openFile=="function"&&Ea.addEventListener("click",HDe),Ea.addEventListener("click",VDe)}function Qw(t,e=!0){const r=Cl();nE.viewMode=t,t!==r&&localStorage.setItem(jw.viewModeCacheKey,String(t));const n=Yr.MarkEdit.editorView;t===0?n.focus():t===2&&n.contentDOM.blur(),t===1?(hC.classList.add(cp.containerClass),nE.splitter??=LDe({columnGutters:[{track:1,element:zE}],minSize:150,onDragStart:()=>CK.disabled=!1,onDragEnd:()=>CK.disabled=!0})):(hC.classList.remove(cp.containerClass),nE.splitter?.destroy(),nE.splitter=void 0),t===2?Ea.classList.add("overlay"):Ea.classList.remove("overlay"),e&&fC()}function BDe(){const t=[0,...B9e.map(n=>{switch(n){case"side-by-side":return 1;case"preview":return 2;default:return}}).filter(n=>n!==void 0)],e=t.indexOf(Cl()),r=e===-1?0:(e+1)%t.length;Qw(t[r])}function FDe(){const t=localStorage.getItem(jw.viewModeCacheKey);if(t===null)return;const e=Number(t);Cl()!==e&&Qw(e,!0)}function Cl(){return nE.viewMode}async function fC(){if(Cl()===0)return;const t=Gce(await Zw());Ea.innerHTML=t,Fce(()=>{cM(Wce(),Z4(),!1);const e=localStorage.getItem(jw.previewPageZoomKey);e!==null&&(Ea.style.zoom=e)})}function $De(t){if(Cl()===0||Cl()===1&&Yr.MarkEdit.editorView.hasFocus||!t.metaKey||t.ctrlKey||t.altKey||t.shiftKey)return;const e=Number(Ea.style.zoom)||1,r=n=>String(Math.min(Math.max(n,.5),3));switch(t.key){case"-":Ea.style.zoom=r(e-.1);break;case"=":Ea.style.zoom=r(e+.1);break;case"0":Ea.style.zoom="1";break;default:return}localStorage.setItem(jw.previewPageZoomKey,Ea.style.zoom),t.preventDefault(),t.stopPropagation()}function zDe(){Xce(!1)}function UDe(){Xce(!0)}async function GDe(){const t=await Zw(!1);await navigator.clipboard.writeText(t)}async function qDe(){const t=await Zw(!1),e=new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([Ea.innerText],{type:"text/plain"})});await navigator.clipboard.write([e])}function Wce(){return Yr.MarkEdit.editorView.scrollDOM}function Z4(){return Ea}async function Kce(t){const e=await Zw(!1);return t?await $ce(e):`
${e}`}async function YDe(t,e){const r=await Hz(t,!1);return e?await $ce(r):`
-${r}`}async function Zw(t=!0){const e=Yr.MarkEdit.editorAPI.getText();{const r=await(async()=>{if(typeof Yr.MarkEdit.getFileInfo!="function")return;const n=await Yr.MarkEdit.getFileInfo();return nNe(n?.filePath)})();if(r===".mmd"||r===".mermaid")return await pDe(e,t);if(r===".tex")return await gDe(e,t)}return await Hz(e,t)}function wK(){const t=getComputedStyle(Ea).backgroundColor;zE.style.background=`linear-gradient(to right, transparent 50%, ${t} 50%)`}async function Xce(t){const e=await(async()=>{const n=await Yr.MarkEdit.getFileInfo();return n===void 0?`${ri("untitled")}.html`:`${rNe(n.filePath)}.html`})(),r=await Kce(t);Yr.MarkEdit.showSavePanel({fileName:e,string:r})}async function HDe(t){if(!(t.target instanceof Element))return;const e=t.target.closest("a");if(e===null)return;const r=e.getAttribute("href");if(!r?.startsWith("../"))return;const n=(await Yr.MarkEdit.getFileInfo())?.parentPath;if(n!==void 0){t.preventDefault(),t.stopPropagation();try{const i=bm(n,decodeURIComponent(r));await Yr.MarkEdit.openFile(i)}catch(i){console.error("Failed to open file:",i)}}}function VDe(t){const e=t.target;if(!(e instanceof HTMLInputElement)||!e.classList.contains("task-list-item-checkbox"))return;const r=e.closest("[data-line-from]");if(r===null){console.error("Failed to find task item block");return}const n=Yr.MarkEdit.editorAPI,i=n.getLineRange(zm(r).from),a=kDe(n.getText(i));if(a===null){e.checked=!e.checked,console.error("Failed to resolve task toggle");return}const s=i.from+a.offset;Yr.MarkEdit.editorView.dispatch({changes:{from:s,to:s+1,insert:a.replacement},annotations:Vce.of(!0)})}const nE={viewMode:0,splitter:void 0};async function uM(){if(FE==="never")return;const t=await jce();typeof t.tag_name=="string"&&t.name!=="1.8.0"&&(Jce().has(t.name)||(FE==="automatic"&&Oz()?await Kz(t.tag_name):FE==="quiet"?(dM.pendingRelease=t,Qce(t)):KDe(t)))}async function WDe(){const t=Date.now(),e=Number(localStorage.getItem(z_.lastCheckCacheKey)??"0");if(!(t-e<2592e5))try{await uM(),localStorage.setItem(z_.lastCheckCacheKey,String(t))}catch(r){console.error("Failed to check for updates:",r)}}async function jce(){return await(await fetch(z_.latestReleaseURL)).json()}async function Kz(t){if(typeof __FILE_PATH__!="string")return console.error("Cannot download the latest build: unknown file path"),!1;try{const e=__FILE_PATH__,r="",n=t===void 0?"main":`refs/tags/${encodeURIComponent(t)}`,i=`${z_.rawBaseURL}${n}/dist/${r}markedit-preview.js`,a=await fetch(i);if(!a.ok)return console.error(`Failed to download the latest build from ${i}`),!1;const s=await a.text();return await Yr.MarkEdit.createFile({path:e,string:s,overwrites:!0})}catch(e){return console.error("Failed to download the latest build:",e),!1}}function Qce(t=dM.pendingRelease){if(t===void 0)return;const e=document.querySelector(`.${cp.updatePillClass}`);if(e!==null){if(e.dataset.releaseName===t.name)return e;e.remove()}const r=document.createElement("button");return r.dataset.releaseName=t.name,r.className=cp.updatePillClass,r.textContent=ri("update"),r.style.display=Cl()===Uc.edit?"none":"",r.addEventListener("webkitmouseforcedown",n=>{n.preventDefault()}),r.addEventListener("click",()=>{const{title:n,actions:i}=Zce(t,()=>{dM.pendingRelease=void 0,r.remove()}),[a,...s]=i,o=r.getBoundingClientRect(),l={x:o.left,y:o.bottom+10};Yr.MarkEdit.showContextMenu([{title:n},a,{separator:!0},...s],l)}),document.body.appendChild(r),r}async function KDe(t){const{title:e,actions:r}=Zce(t),n=await Yr.MarkEdit.showAlert({title:e,message:t.body,buttons:r.map(i=>i.title)});r[n]?.action?.()}function Zce(t,e=()=>{}){const r=`MarkEdit-preview ${t.name} ${ri("newVersionAvailable")}`,n=[...Oz()?[{title:ri("updateAndRelaunch"),action:async()=>{await Kz(t.tag_name)?Yr.MarkEdit.relaunchApp():Yr.MarkEdit.showAlert(ri("failedToUpdate")),e()}}]:[],{title:ri("viewReleasePage"),action:()=>{open(t.html_url),e()}},{title:ri("remindMeLater"),action:e},{title:ri("skipThisVersion"),action:()=>{const i=Jce();i.add(t.name),localStorage.setItem(z_.skippedCacheKey,JSON.stringify([...i])),e()}}];return{title:r,actions:n}}function Jce(){const t=localStorage.getItem(z_.skippedCacheKey);return new Set(JSON.parse(t??"[]"))}const z_={latestReleaseURL:"https://api.github.com/repos/MarkEdit-app/MarkEdit-preview/releases/latest",rawBaseURL:"https://raw.githubusercontent.com/MarkEdit-app/MarkEdit-preview/",lastCheckCacheKey:"updater.last-check-time",skippedCacheKey:"updater.skipped-versions"},dM={pendingRelease:void 0},hM="markedit-preview",kK=`${hM}.js`;function XDe(t){const{destExists:e,bundleInfo:r,currentVersion:n}=t,i=r?.version===n,a=r?.fullBuild===!0;return!(e&&i&&a)}async function jDe(){try{const t=Yr.MarkEdit.getDirectoryPath("documents"),e=Yr.MarkEdit.getDirectoryPath("sharedContainer");if(t===void 0||e===void 0){console.error("Required directories are not accessible");return}const r=typeof __FILE_PATH__=="string"?__FILE_PATH__:bm(t,`scripts/${kK}`);if(await Yr.MarkEdit.getFileInfo(r)===void 0){console.error(`Source file not found at ${r}`);return}const i=r.split("/").pop()??kK,a=bm(e,"Shared/scripts"),s=bm(a,i),o=await Yr.MarkEdit.getFileInfo(s)!==void 0,l=bm(e,"Shared/metadata.json"),u=await oNe(l),d=u[hM];if(!XDe({destExists:o,bundleInfo:d,currentVersion:"1.8.0"}))return;const h=await Yr.MarkEdit.getFileContent(r);if(h===void 0){console.error(`Failed to read content from ${r}`);return}await Yr.MarkEdit.createFile({path:a,isDirectory:!0}),await Yr.MarkEdit.createFile({path:s,string:h,overwrites:!0}),await Yr.MarkEdit.createFile({path:l,string:JSON.stringify({...u,[hM]:{version:"1.8.0",fullBuild:!0}},null,2),overwrites:!0})}catch(t){console.error("Failed to copy the current file to shared container:",t)}}function QDe(){const t=AK(ri("source")),e=AK(ri("preview")),r=document.createElement("div");r.className="quicklook-segmented",r.setAttribute("role","tablist"),r.append(t,e);const n=document.createElement("div");return n.className="quicklook-toolbar",n.appendChild(r),{toolbar:n,sourceButton:t,previewButton:e}}function AK(t){const e=document.createElement("button");return e.textContent=t,e.type="button",e.className="quicklook-segment",e.setAttribute("role","tab"),e}function em(){if(tm!==void 0)return tm;try{tm=localStorage.getItem(eue)==="preview"?"preview":"source"}catch{console.error("Failed to read quick look mode from localStorage"),tm="source"}return tm}function RK(t){tm=t;try{localStorage.setItem(eue,t)}catch{console.error("Failed to write quick look mode to localStorage")}}let tm;const eue="ui.quicklook-mode";function ZDe(){const t=window,e=t.editor?.state?.doc.toString();return typeof e=="string"?e:(console.error("Failed to get text from host editor state"),t.config?.text??"")}function JDe(){document.addEventListener("webkitmouseforcewillbegin",t=>{const e=t.target;e instanceof Element&&e.closest("a")!==null&&t.preventDefault()})}function eLe(t,e){const r=window,n=r.pinchZoomTarget;r.pinchZoomTarget=()=>{if(t()!=="preview")return n?.()??null;const i=e.querySelector(".quicklook-content");return i!==null?{scroller:e,inner:i}:null}}function tLe(t,e){let r;const n=window,i={start:n.startDragging,update:n.updateDragging,cancel:n.cancelDragging},a=()=>{const o=e.clientHeight,l=e.scrollHeight,u=l-o;if(u<=0||l<=0)return{clientHeight:o,scrollHeight:l,scrollbarHeight:o,scrollbarTop:0};const d=o*(o/l),f=e.scrollTop/u*(o-d);return{clientHeight:o,scrollHeight:l,scrollbarHeight:d,scrollbarTop:f}},s=(o,l,u="auto")=>{const{clientHeight:d,scrollHeight:h,scrollbarHeight:f}=a(),p=d-f;if(p>0){const g=(o-l)/p;e.scrollTo({top:g*(h-d),behavior:u})}};n.startDragging=o=>{if(t()!=="preview"){i.start?.(o);return}const{scrollbarTop:l,scrollbarHeight:u}=a(),d=NK(e,o);r=d-l,(dl+u)&&s(d,u*.5,"smooth")},n.updateDragging=o=>{if(t()!=="preview"){i.update?.(o);return}r!==void 0&&s(NK(e,o),r)},n.cancelDragging=()=>{if(t()!=="preview"){i.cancel?.();return}r=void 0}}function rLe(t,e,r){r.addEventListener("wheel",n=>{const i=t()==="preview"?e:document.querySelector(".cm-scroller");i!==null&&(i.scrollTop+=n.deltaY,i.scrollLeft+=n.deltaX,n.preventDefault())},{passive:!1})}function nLe(t,e,r){const n=document.querySelector(".cm-scroller"),i=()=>{const s=(t()==="preview"?e:n)?.scrollTop??0;r.classList.toggle("scrolled",s>0),r.classList.toggle("scrolled-far",s>20)};return e.addEventListener("scroll",i,{passive:!0}),n?.addEventListener("scroll",i,{passive:!0}),i}function NK(t,e){return e-t.getBoundingClientRect().top}const iLe=`body {
+${r}`}async function Zw(t=!0){const e=Yr.MarkEdit.editorAPI.getText();{const r=await(async()=>{if(typeof Yr.MarkEdit.getFileInfo!="function")return;const n=await Yr.MarkEdit.getFileInfo();return nNe(n?.filePath)})();if(r===".mmd"||r===".mermaid")return await pDe(e,t);if(r===".tex")return await gDe(e,t)}return await Hz(e,t)}function wK(){const t=getComputedStyle(Ea).backgroundColor;zE.style.background=`linear-gradient(to right, transparent 50%, ${t} 50%)`}async function Xce(t){const e=await(async()=>{const n=await Yr.MarkEdit.getFileInfo();return n===void 0?`${ri("untitled")}.html`:`${rNe(n.filePath)}.html`})(),r=await Kce(t);Yr.MarkEdit.showSavePanel({fileName:e,string:r})}async function HDe(t){if(!(t.target instanceof Element))return;const e=t.target.closest("a");if(e===null)return;const r=e.getAttribute("href");if(!r?.startsWith("../"))return;const n=(await Yr.MarkEdit.getFileInfo())?.parentPath;if(n!==void 0){t.preventDefault(),t.stopPropagation();try{const i=bm(n,decodeURIComponent(r));await Yr.MarkEdit.openFile(i)}catch(i){console.error("Failed to open file:",i)}}}function VDe(t){const e=t.target;if(!(e instanceof HTMLInputElement)||!e.classList.contains("task-list-item-checkbox"))return;const r=e.closest("[data-line-from]");if(r===null){console.error("Failed to find task item block");return}const n=Yr.MarkEdit.editorAPI,i=n.getLineRange(zm(r).from),a=kDe(n.getText(i));if(a===null){e.checked=!e.checked,console.error("Failed to resolve task toggle");return}const s=i.from+a.offset;Yr.MarkEdit.editorView.dispatch({changes:{from:s,to:s+1,insert:a.replacement},annotations:Vce.of(!0)})}const nE={viewMode:0,splitter:void 0};async function uM(){if(FE==="never")return;const t=await jce();typeof t.tag_name=="string"&&t.name!=="1.8.0"&&(Jce().has(t.name)||(FE==="automatic"&&Oz()?await Kz(t.tag_name):FE==="quiet"?(dM.pendingRelease=t,Qce(t)):KDe(t)))}async function WDe(){const t=Date.now(),e=Number(localStorage.getItem(z_.lastCheckCacheKey)??"0");if(!(t-e<2592e5))try{await uM(),localStorage.setItem(z_.lastCheckCacheKey,String(t))}catch(r){console.error("Failed to check for updates:",r)}}async function jce(){return await(await fetch(z_.latestReleaseURL)).json()}async function Kz(t){if(typeof __FILE_PATH__!="string")return console.error("Cannot download the latest build: unknown file path"),!1;try{const e=__FILE_PATH__,r="",n=t===void 0?"main":`refs/tags/${encodeURIComponent(t)}`,i=`${z_.rawBaseURL}${n}/dist/${r}markedit-preview.js`,a=await fetch(i);if(!a.ok)return console.error(`Failed to download the latest build from ${i}`),!1;const s=await a.text();return await Yr.MarkEdit.createFile({path:e,string:s,overwrites:!0})}catch(e){return console.error("Failed to download the latest build:",e),!1}}function Qce(t=dM.pendingRelease){if(t===void 0)return;const e=document.querySelector(`.${cp.updatePillClass}`);if(e!==null){if(e.dataset.releaseName===t.name)return e;e.remove()}const r=document.createElement("button");return r.dataset.releaseName=t.name,r.className=cp.updatePillClass,r.textContent=ri("update"),r.style.display=Cl()===Uc.edit?"none":"",r.addEventListener("webkitmouseforcedown",n=>{n.preventDefault()}),r.addEventListener("click",()=>{const{title:n,actions:i}=Zce(t,()=>{dM.pendingRelease=void 0,r.remove()}),[a,...s]=i,o=r.getBoundingClientRect(),l={x:o.left,y:o.bottom+10};Yr.MarkEdit.showContextMenu([{title:n},a,{separator:!0},...s],l)}),document.body.appendChild(r),r}async function KDe(t){const{title:e,actions:r}=Zce(t),n=await Yr.MarkEdit.showAlert({title:e,message:t.body,buttons:r.map(i=>i.title)});r[n]?.action?.()}function Zce(t,e=()=>{}){const r=`MarkEdit-preview ${t.name} ${ri("newVersionAvailable")}`,n=[...Oz()?[{title:ri("updateAndRelaunch"),action:async()=>{await Kz(t.tag_name)?Yr.MarkEdit.relaunchApp():Yr.MarkEdit.showAlert(ri("failedToUpdate")),e()}}]:[],{title:ri("viewReleasePage"),action:()=>{open(t.html_url),e()}},{title:ri("remindMeLater"),action:e},{title:ri("skipThisVersion"),action:()=>{const i=Jce();i.add(t.name),localStorage.setItem(z_.skippedCacheKey,JSON.stringify([...i])),e()}}];return{title:r,actions:n}}function Jce(){const t=localStorage.getItem(z_.skippedCacheKey);return new Set(JSON.parse(t??"[]"))}const z_={latestReleaseURL:"https://api.github.com/repos/MarkEdit-app/MarkEdit-preview/releases/latest",rawBaseURL:"https://raw.githubusercontent.com/MarkEdit-app/MarkEdit-preview/",lastCheckCacheKey:"updater.last-check-time",skippedCacheKey:"updater.skipped-versions"},dM={pendingRelease:void 0},hM="markedit-preview",kK=`${hM}.js`;function XDe(t){const{destExists:e,bundleInfo:r,currentVersion:n}=t,i=r?.version===n,a=r?.fullBuild===!0;return!(e&&i&&a)}async function jDe(){try{const t=Yr.MarkEdit.getDirectoryPath("documents"),e=Yr.MarkEdit.getDirectoryPath("sharedContainer");if(t===void 0||e===void 0){console.error("Required directories are not accessible");return}const r=typeof __FILE_PATH__=="string"?__FILE_PATH__:bm(t,`scripts/${kK}`);if(await Yr.MarkEdit.getFileInfo(r)===void 0){console.error(`Source file not found at ${r}`);return}const i=r.split("/").pop()??kK,a=bm(e,"Shared/scripts"),s=bm(a,i),o=await Yr.MarkEdit.getFileInfo(s)!==void 0,l=bm(e,"Shared/metadata.json"),u=await oNe(l),d=u[hM];if(!XDe({destExists:o,bundleInfo:d,currentVersion:"1.8.0"}))return;const h=await Yr.MarkEdit.getFileContent(r);if(h===void 0){console.error(`Failed to read content from ${r}`);return}await Yr.MarkEdit.createFile({path:a,isDirectory:!0}),await Yr.MarkEdit.createFile({path:s,string:h,overwrites:!0}),await Yr.MarkEdit.createFile({path:l,string:JSON.stringify({...u,[hM]:{version:"1.8.0",fullBuild:!0}},null,2),overwrites:!0})}catch(t){console.error("Failed to copy the current file to shared container:",t)}}function QDe(){const t=AK(ri("source")),e=AK(ri("preview")),r=document.createElement("div");r.className="quicklook-segmented",r.setAttribute("role","tablist"),r.append(t,e);const n=document.createElement("div");return n.className="quicklook-toolbar",n.appendChild(r),{toolbar:n,sourceButton:t,previewButton:e}}function AK(t){const e=document.createElement("button");return e.textContent=t,e.type="button",e.className="quicklook-segment",e.setAttribute("role","tab"),e}function em(){if(tm!==void 0)return tm;try{tm=localStorage.getItem(eue)==="preview"?"preview":"source"}catch{console.error("Failed to read quick look mode from localStorage"),tm="source"}return tm}function RK(t){tm=t;try{localStorage.setItem(eue,t)}catch{console.error("Failed to write quick look mode to localStorage")}}let tm;const eue="ui.quicklook-mode";function ZDe(){const t=window,e=t.editor?.state?.doc.toString();return typeof e=="string"?e:(console.error("Failed to get text from host editor state"),t.config?.text??"")}function JDe(){document.addEventListener("webkitmouseforcewillbegin",t=>{const e=t.target;e instanceof Element&&e.closest("a")!==null&&t.preventDefault()})}function eLe(t,e){const r=window,n=r.pinchZoomTarget;r.pinchZoomTarget=()=>{if(t()!=="preview")return n?.()??null;const i=e.querySelector(".quicklook-content");return i!==null?{scroller:e,inner:i}:null};for(const i of["gesturechange","gestureend"])document.addEventListener(i,()=>{if(t()!=="preview")return;const a=e.querySelector(".quicklook-content");a?.style.setProperty("--quicklook-zoom",a.style.zoom||"0.9")},{passive:!1})}function tLe(t,e){let r;const n=window,i={start:n.startDragging,update:n.updateDragging,cancel:n.cancelDragging},a=()=>{const o=e.clientHeight,l=e.scrollHeight,u=l-o;if(u<=0||l<=0)return{clientHeight:o,scrollHeight:l,scrollbarHeight:o,scrollbarTop:0};const d=o*(o/l),f=e.scrollTop/u*(o-d);return{clientHeight:o,scrollHeight:l,scrollbarHeight:d,scrollbarTop:f}},s=(o,l,u="auto")=>{const{clientHeight:d,scrollHeight:h,scrollbarHeight:f}=a(),p=d-f;if(p>0){const g=(o-l)/p;e.scrollTo({top:g*(h-d),behavior:u})}};n.startDragging=o=>{if(t()!=="preview"){i.start?.(o);return}const{scrollbarTop:l,scrollbarHeight:u}=a(),d=NK(e,o);r=d-l,(dl+u)&&s(d,u*.5,"smooth")},n.updateDragging=o=>{if(t()!=="preview"){i.update?.(o);return}r!==void 0&&s(NK(e,o),r)},n.cancelDragging=()=>{if(t()!=="preview"){i.cancel?.();return}r=void 0}}function rLe(t,e,r){r.addEventListener("wheel",n=>{const i=t()==="preview"?e:document.querySelector(".cm-scroller");i!==null&&(i.scrollTop+=n.deltaY,i.scrollLeft+=n.deltaX,n.preventDefault())},{passive:!1})}function nLe(t,e,r){const n=document.querySelector(".cm-scroller"),i=()=>{const s=(t()==="preview"?e:n)?.scrollTop??0;r.classList.toggle("scrolled",s>0),r.classList.toggle("scrolled-far",s>20)};return e.addEventListener("scroll",i,{passive:!0}),n?.addEventListener("scroll",i,{passive:!0}),i}function NK(t,e){return e-t.getBoundingClientRect().top}const iLe=`body {
--editor-inset-top: 34px;
}
@@ -2126,9 +2126,9 @@ ${r}`}async function Zw(t=!0){const e=Yr.MarkEdit.editorAPI.getText();{const r=a
zoom: 0.9;
/* Pull content under the toolbar (scroller stays inset to keep its scrollbar clear) */
- margin-top: calc(-1 * var(--editor-inset-top) / 0.9) !important;
+ margin-top: calc(-1 * var(--editor-inset-top) * 0.9 / var(--quicklook-zoom, 0.9)) !important;
/* Restore the height the negative margin removed so bouncing stays in the pane, not the page */
- min-height: calc(100% + var(--editor-inset-top) / 0.9 + 1px);
+ min-height: calc(100% + var(--editor-inset-top) + 1px);
}
/* Links are not interactive in quicklook */
diff --git a/src/quicklook/interaction.ts b/src/quicklook/interaction.ts
index 980407b..9653151 100644
--- a/src/quicklook/interaction.ts
+++ b/src/quicklook/interaction.ts
@@ -31,6 +31,19 @@ export function interceptPinchZoom(getMode: () => Mode, previewPane: HTMLElement
const inner = previewPane.querySelector('.quicklook-content');
return inner !== null ? { scroller: previewPane, inner } : null;
};
+
+ // The toolbar-clearance margin lives on the zoomed element, so `zoom` scales it.
+ // Track the live zoom in `--quicklook-zoom` so the margin can divide it back out (see CSS).
+ for (const event of ['gesturechange', 'gestureend'] as const) {
+ document.addEventListener(event, () => {
+ if (getMode() !== 'preview') {
+ return;
+ }
+
+ const inner = previewPane.querySelector('.quicklook-content');
+ inner?.style.setProperty('--quicklook-zoom', inner.style.zoom || '0.9');
+ }, { passive: false });
+ }
}
/**
diff --git a/styles/quicklook.css b/styles/quicklook.css
index 5ecd3c4..e4ba58b 100644
--- a/styles/quicklook.css
+++ b/styles/quicklook.css
@@ -12,9 +12,9 @@ body {
zoom: 0.9;
/* Pull content under the toolbar (scroller stays inset to keep its scrollbar clear) */
- margin-top: calc(-1 * var(--editor-inset-top) / 0.9) !important;
+ margin-top: calc(-1 * var(--editor-inset-top) * 0.9 / var(--quicklook-zoom, 0.9)) !important;
/* Restore the height the negative margin removed so bouncing stays in the pane, not the page */
- min-height: calc(100% + var(--editor-inset-top) / 0.9 + 1px);
+ min-height: calc(100% + var(--editor-inset-top) + 1px);
}
/* Links are not interactive in quicklook */