zsviczian / obsidian-excalidraw-plugin

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

BUG: Heading link rendering inconsistent when punctuation present #960

Open ryanwwest opened 1 year ago

ryanwwest commented 1 year ago

Your environment

SYSTEM INFO: Obsidian version: v1.1.9 Installer version: v1.0.3 Operating system: Windows 10 Home 10.0.22621 Login status: not logged in Insider build toggle: off Live preview: on Legacy editor: off Base theme: adapt to system Community theme: none Snippets enabled: 6 Restricted mode: off Plugins installed: 52 Plugins enabled: 41 1: Zoom v1.1.1 2: Spaced Repetition v1.9.1 3: Vault Statistics v0.1.3 4: Templater v1.16.0 5: Style Settings v0.4.12 6: Settings Search v1.2.0 7: Recent Files v1.3.5 8: Natural Language Dates v0.6.1 9: Excalidraw v1.8.6 10: Hotkeys for specific files v1.2.0 11: Dynamic Highlights v0.3.1 12: Editor Syntax Highlight v0.1.3 13: Drag-n-Drop for blocks v1.2.0 14: DB Folder v3.1.0 15: Dataview v0.5.52 16: Cycle through Panes v0.1.0 17: Copy Block Link v1.0.4 18: Custom Attachment Location v0.0.9 19: Citations v0.4.5 20: Book Search v0.5.8 21: Find orphaned files and broken links v1.8.0 22: Vimrc Support v0.8.0 23: Text Format v2.2.1 24: Hider v1.2.4 25: Quick Explorer v0.2.7 26: Advanced Slides v1.19.0 27: Obsidian42 - BRAT v0.6.36 28: Hover Editor v0.11.8 29: Notion-Like Tables v5.0.5 30: Paste URL into selection v1.7.0 31: Hot Reload v0.1.10 32: Vim Yank Highlighter v1.1.4 33: Divide & Conquer v1.0.0 34: Annotator v0.2.8 35: Plugin Update Tracker v1.4.3 36: _Structural Editing v0.0.4 37: Quiet Outline v0.3.14 38: Self-hosted LiveSync v0.17.5 39: Excel to Markdown Table v0.4.0 40: Completr v3.1.0 41: Emoji Shortcodes v2.2.0 (I know, way too many!!!)

Describe the bug

Obsidian's Wikilinks to headings do not have to exactly match the heading text - it seems they can remove punctuation (sometimes, it's possibly buggy) or allow for extra spaces. I don't know why this is supported, but other plugins like https://github.com/mgmeyers/obsidian-copy-block-link auto-remove punctuation when generating a heading link and Obsidian still treats them as working links.

However, Excalidraw often does not recognize the link connections if punctuation is missing, or possibly even if some punctuation like + are found in the heading text at all.

To Reproduce

Try something like this, and note that all three embed links (to two headings) rendered properly:

image

The same three embed links are shown in a drawing and only the third one renders correctly, even though all three render in default Obsidian:

image

Expected behavior

Everything that Obsidian can render as an embed should ideally be interchangeable and renderable in Excalidraw as well.

Additional context

A separate bug may actually manifest itself if you're using rectangles to type your text embeds into on a drawing - if you're copying longer amounts of text in, it temporarily increases the height of the rectangle much more than necessary (often going far below the screen) and decenters the text until you type another character (and if you hit escape before typing another character, it saves it like this):

image

zsviczian commented 1 year ago

I implemented a related fix in 1.9.14. Can you confirm that this issue is resolved?