FHachez / obsidian-convert-url-to-iframe

Plugin for Obsidian.md to convert a selected URL to an iframe.
200 stars 17 forks source link

URL converted to iframe wrongly #38

Closed okramovic closed 2 years ago

okramovic commented 2 years ago

this inline string (part of paragraph): https://www.youtube.com/watch?v=Sujxj8uM9gw was converted into (via right click/URL to preview/iframe, just hitting the OK button in the dialog):

<div style="display: block; position: relative; width: 100%; height: 0px; --aspect-ratio:9/16; padding-bottom: calc(var(--aspect-ratio) * 100%);"><iframe src="<iframe src=&quot;https://www.youtube.com/embed/Sujxj8uM9gw?feature=oembed&quot; height=&quot;113&quot; width=&quot;200&quot;></iframe>" allow="fullscreen" style="position: absolute; top: 0px; left: 0px; height: 100%; width: 100%;"></iframe></div>

Screenshot 2022-01-23 at 06 17 55

And FYI, already in the dialogue (one where you set the aspect ratio) there's nothing previewed, just empty frame.

okramovic commented 2 years ago

I run free account on version 0.13.19, restarting Obs. did not help

FHachez commented 2 years ago

@okramovic Indeed, the output is not correct in this case. The iframe src is not an url but the iframe data. This is the behavior if you have an old version of the "Obsidian installer". You should get a warning in the iframe dialog.

Meanwhile, the faster way to fix the issue for you is to update the Obsidian installer.

You are indeed on one of the latest version of Obsidian but not of the "Obsidian installer". Can you have a look in the settings in about? If you have a recent Obsidian installer we can generate a cleaner output that doesn't have the bug.

As you can see there are two versions, the obsidian version and the "Obsidian installer" version: image

How to get the latest Obsidian Installer:

You have to re-download Obsidian to get the latest Obsidian Installer version.

On the latest Obsidian Installer:

image

image

okramovic commented 1 year ago

i only got back to it now. by now it all seems good, thanks for the answer :)

FHachez commented 1 year ago

Top, great to hear 👌