Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Url to Iframe from Templater #58

Open
Di3mex opened this issue Sep 18, 2023 · 0 comments
Open

Calling Url to Iframe from Templater #58

Di3mex opened this issue Sep 18, 2023 · 0 comments

Comments

@Di3mex
Copy link

Di3mex commented Sep 18, 2023

I am in the process of building a Templater template for youtube videos. On the top of the note I would love to have the video in an iFrame. So far I have this

# Video
<%* 
let clipboardContent = tp.system.clipboard();
this.app.plugins.plugins['convert-url-to-iframe'].urlToIframe(clipboardContent); 
-%>
## Transcript
<%* app.commands.executeCommandById('ytranscript:paste-transcript') -%>

I get the following error:

plugin:convert-url-to-iframe:6653 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'cmEditor')
    at FormatNotionPlugin.eval (plugin:convert-url-to-iframe:6653:49)
    at Generator.next (<anonymous>)
    at eval (plugin:convert-url-to-iframe:49:61)
    at new Promise (<anonymous>)
    at __async (plugin:convert-url-to-iframe:33:10)
    at FormatNotionPlugin.urlToIframe (plugin:convert-url-to-iframe:6651:12)
    at eval (eval at <anonymous> (plugin:templater-obsidian:1:1), <anonymous>:10:51)
    at eval (plugin:templater-obsidian:3537:35)
    at handleError (plugin:templater-obsidian:3324:14)
    at imports.wbg.__wbg_call_168da88779e35f61 (plugin:templater-obsidian:3536:12)

This is the first time I am trying to directly call a function in a plugin. So maybe that is not a great idea. I could potentially work around this issue by adding a function that takes the URL from the clipboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant