zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
3.99k stars 214 forks source link

BUG: Images doesn't fit within the "Default width of a transcluded markdown document" #904

Open caglarongan opened 1 year ago

caglarongan commented 1 year ago

Your environment SYSTEM INFO: Obsidian version: v1.0.3 Installer version: v0.15.9 Operating system: Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 22.1.0 Login status: logged in Catalyst license: insider Insider build toggle: on Live preview: off Legacy editor: off Base theme: dark Community theme: Minimal Snippets enabled: 19 Restricted mode: off Plugins installed: 58 Plugins enabled: 56 1: Minimal Theme Settings v6.1.0 2: Style Settings v0.4.12 3: Kanban v1.5.1 4: Image Toolkit v1.3.1 5: Admonition v9.0.5 6: Advanced Tables v0.17.3 7: Dataview v0.5.47 8: MetaEdit v1.7.2 9: Calendar v1.5.10 10: Tag Wrangler v0.5.5 11: Periodic Notes v0.0.17 12: Folder Note v0.7.3 13: QuickAdd v0.7.0 14: Lapel v0.1.0 15: Force note view mode v1.1.1 16: Buttons v0.4.19 17: Templater v1.16.0 18: Sortable v0.2.6 19: Hider v1.2.3 20: Clear Unused Images v1.0.6 21: Paste URL into selection v1.7.0 22: DB Folder v2.9.2 23: Snippet Downloader v2.0.1 24: Icon Folder v1.4.1 25: List Callouts v1.0.10 26: Copy Block Link v1.0.4 27: Mousewheel Image zoom v1.0.13 28: Simple Embeds v1.13.0 29: Outliner v4.1.1 30: Hard Breaks v0.1.1 31: Zotero Integration v2.2.31 32: Supercharged Links v0.9.3 33: Note Refactor v1.7.1 34: Raindrop Highlights v0.0.14 35: Obsidian Leaflet v5.1.1 36: Map View v2.2.0 37: Breadcrumbs v3.6.4 38: Hover Editor v0.11.8 39: Creases v0.6.5 40: Task Collector (TC) v0.7.8 41: Metadata Menu v0.3.9 42: Icon Shortcodes v0.9.7 43: Footnote Shortcut v0.0.9 44: Tidy Footnotes v0.1.1 45: Excalidraw v1.8.0 46: ExcaliBrain v0.1.11 47: Markdown Table Editor v0.3.1 48: Pandoc Plugin v0.4.1 49: Commander v0.3.0 50: Banners v1.3.3 51: Customizable Menu v2.2.0 52: Smart Typography v1.0.18 53: Hotkeys for specific files v1.2.0 54: Dynbedded v1.0.0 55: Diagrams v1.5.0 56: Contextual Typography v2.2.4

RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the bug

When you insert (embed) markdown file. The images inside the md file, doesn't fit within the Default width of a transcluded markdown document.

To Reproduce Steps to reproduce the behavior:

  1. Go to Obsidian Icon
  2. Click on 'Insert Markdown file from vault' 3.Select a markdown file which includes images larger than the default width of transcluded md documents
  3. See error

Expected behavior To be able to embed images as proportionate as usual Reading View. (I'm not expecting my theme's css to be rendered, I'm aware of the customizing md embeds for excalidraw)

Screenshots

excalidraw-default md embed

Additional context When I manually resize the transclusion inside the original note to make it fit, it fits. But I have to manually change width of each image in each file.

zsviczian commented 1 year ago

I think you should be able to control this behavior with the markdown embed css. However, I will look to change the default CSS provided, to size images differently.

caglarongan commented 1 year ago

I'm trying with my no knowledge in css but every time I break something else :)

For example, I added foreignObject img {width: 500px; } to markdown-embed.css This is what I got:

with css

Also, here's my settings: excali settings


It automatically renders with the max height. When I change the max height, proportions of the transclusion also changes. Ratio is always default width x max height. But the width is never as the default.

I'm so lost :')