Skip to content

Commit

Permalink
fix: remove cursor: zoom-in style for HTML exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Mar 22, 2022
1 parent 07f05dd commit e7a2a99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderer/components/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,15 @@ export default defineComponent({
border-bottom: 1px solid;
}
img {
--skip-contain: 1;
cursor: zoom-in;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
cursor: zoom-in;
&.inline,
&[src*=".inline"],
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/services/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ export function getPreviewStyles () {
rule.selectorText.includes('.markdown-body') ||
rule.selectorText.startsWith('.katex')
)) {
// skip contain rules
if (rule?.style?.getPropertyValue('--skip-contain')) {
return
}

styles += rule.cssText.replace(/\.markdown-view /g, '') + '\n'
}
})
Expand Down

0 comments on commit e7a2a99

Please sign in to comment.