JichouP / obsidian-marp-plugin

Plugin to use Marp with Obsidian

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URIError: URI malformed

d4rr3ll opened this issue · comments

Great plugin btw! Was literally looking for this and you started writing it last week.

Unfortunately 1.0.1 was working for me, 1.0.3 isn't :(

Even with some really simple Markdown I'm getting this error in the console.

Uncaught (in promise) URIError: URI malformed
    at decodeURI (<anonymous>)
    at Ix (plugin:marp:3401:2289)
    at async cp.renderPreview (plugin:marp:3438:983)

Obsidian 1.1.15 - macOS Monterey 12.6.3 (same as yesterday when it was working.

I also noticed this unrelated error as well as I had tried to specific a themes directory in my setting which was in the wrong place, the plugin was looking in the root of my Vault.

Uncaught (in promise) Error: ENOENT: no such file or directory, scandir '<REDACTED PATH TO MY VAULT>/marp-themes'

Extra info, it appears to be when trying to scale a background image:

This works

![Test bg](some-local-image.png)

This doesn't

![Test bg 40%](some-local-image.png)

This didn't actually render at all yesterday, but didn't fail quite so hard.

@d4rr3ll
Thanks for the detailed report!
I have released a version 1.1.0 that fixes this problem and will close this issue.
As for the bug in the themes directory, I still do not know the cause, so we have created a new issue #21 . Please take a look there!

Thanks for the quick response @JichouP - It seems like that fix has lost the relative path for all the images and fonts now :(

I was previously seeing this INFO in the logs before upgrading to 1.1.0...

background-image:url("app://local/Users/<REDACTED PATH TO VAULT>/<SUB PATH IN VAULT>/logo-image.png?1544436122000")

But now I see multiple errors for a lot of the assets, e.g. for the specific file above:

GET app://obsidian.md/logo-image.png net::ERR_FILE_NOT_FOUND

@d4rr3ll
Does this error occur if you include sub-paths as relative paths in your images?
like:

![Test bg 40%](<SUB PATH IN VAULT>/logo-image.png)

@JichouP Yeah, that works, thanks.

My only point on that is that it makes it less interchangeable with the marp cli, which is where I'm coming from traditionally. Happy to go with this though as the the workflow is much much better than working in the cli.