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

[Plugin][Bug]: Regex on filename / folder path does not function as expected #206

Closed
2 tasks done
HighPriest opened this issue Aug 24, 2023 · 4 comments
Closed
2 tasks done
Assignees
Labels
🐛 Bug Something isn't working 💎 Obsidian Github Publisher Related to the plugin

Comments

@HighPriest
Copy link

HighPriest commented Aug 24, 2023

Issue validation

  • I checked the issue to prevent duplicate
  • I checked my configurations files and the documentation

Command used

Upload all notes

Plugin version

6.4.0

Describe the bug

The Regex on filename / folder path has two issues for me:

  1. Escaping special characters.
    In regex () characters or [] have their special meaning. To match them in text we need to escape them with \. But adding the backslash to regex, throws an error Folder path cannot contain the character `.
  2. The tool does not check for trailing slash / after the folder path string has been cleaned up.
    So, if I want to remove hentai_stash from source/hentai_stash/hatsune_miku.mp3 I have to match for /hentai_stash, while hentai_stash should be sufficient. But even worse! While hentai_stash is going to throw an error. hentai_stash/ is not going to match at all and fail silently!

Maybe related to #115

How to reproduce ?

No response

Minimal Reproducible Example

^Explained in description

Configuration

No need

Relevant log output

This comes up when folder name is used without preceding /

HttpError: path contains a malformed path component: {"resource":"Commit","field":"path","code":"invalid"}
    at eval (plugin:obsidian-mkdocs-publisher:17:56241)

OS

Windows

Anything else?

No response

Obsidian information

SYSTEM INFO:
	Obsidian version: v1.3.7
	Installer version: v1.3.7
	Operating system: Windows 10
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 6
	Plugins enabled: 5
		1: Simple Embeds v1.14.1
		2: Tasks Calendar Wrapper v0.2.5
		3: Tasks v4.6.0
		4: ReadItLater v0.3.1
		5: Github Publisher v6.4.0
@HighPriest HighPriest added 🐛 Bug Something isn't working 💎 Obsidian Github Publisher Related to the plugin labels Aug 24, 2023
@Mara-Li
Copy link
Member

Mara-Li commented Aug 24, 2023

Do you use:

  • YAML
  • Obsidian Path
  • Or fixed folder ?

@HighPriest
Copy link
Author

Obsidian path, dear @Lisandra-dev

@Mara-Li
Copy link
Member

Mara-Li commented Aug 24, 2023

Hmm, I don't understand well this:

The tool does not check for trailing slash / after the folder path string has been cleaned up.
So, if I want to remove hentai_stash from source/hentai_stash/hatsune_miku.mp3 I have to match for /hentai_stash, while hentai_stash should be sufficient. But even worse! While hentai_stash is going to throw an error. hentai_stash/ is not going to match at all and fail silently!

If I'm correct, the tool must use source/hentai_stash/hatsune_miku.mp3source//hatsune_miku.mp3 in the "actual state" of the plugin regex, no ?
EDIT: Yeah, it's is that.
Okay will fix it asap, thanks

@Mara-Li
Copy link
Member

Mara-Li commented Aug 24, 2023

As I do a big refactor, the update is behind them. If you want to try it, you can install it with BRAT using https://github.com/ObsidianPublisher/obsidian-github-publisher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 💎 Obsidian Github Publisher Related to the plugin
Projects
None yet
Development

No branches or pull requests

2 participants