I love this plug in, and it is incredibly useful but I think it has been corrupting the image files that are in my vault. Here is what I tracked down this morning:

Data Loss when using Filename Header Sync

I have not looked at the code yet, but maybe add a guard to ignore any filetypes other than .md?

Thanks for reporting, this was addressed immediately and the faulty version unpublished+blacklisted. 1.5.1 has a strict guard to only act on markdown files

1 Like

Hy @sararkin

My question isn’t related about your plugin. Can you show me how did you set-up these marked lines to show in your pane.

1 Like

I believe he linked it up thread but the tool there is now deprecated and it’s just a Backlinks in Document toggle

@sararkin
I’m just a noob with javascript, but I may have found a way to improve a piece of your code.

(I don’t know how to use GitHub yet, otherwise I would make a push request or whatever it is called)

I tried putting a [[wiki-link]] in the first header, thinking the square brackets would automatically get filtered out. Instead, I was confused when only one pair of brackets was removed, and other similarly strange results.

Looking at your code, I found the culprit: the function sanitizeHeading() (line 231 in main.ts) uses replace(string, '') instead of replace(regExp, '').

I think I figured out how to do it on GitHub.

I don’t know what happen with this plugin when used with obsidian sync. When I update the H1 title, the filename is adapted, but then I have duplicate files.
Ex:
I have a note the-book.md
I open this node and change heading: # the-book becomes # B-the-book
the plugin updates automatically the filename
but then I see 2 files:

  • the-book.md
  • B-the-book.md

+2!

Synching the Frontmatter Title to the file name as an option would be a terrific benefit!

Cheers!

+3
For syncing frontmatter title.

I’m trying to have this plug-in ignore my template files, because it otherwise inserts #Untitled at the end of each new file. I’ve set the Ignore Regex Rule to /* Bins/Templates since my templates are in * Bins/Templates:
2022-02-11-1114-07
But it’s still putting #Untitled at the end of the files.

What am I doing wrong?

Thanks,
Russell

My regex rule is actually: /\* Bins/Templates

Am I dealing with the asterisk correctly?

Does it display your templates in the settings page to show that they are ignored?

I think the correct regex would be .*Bins\/Templates.*, can you give that a go?

With your regex, the templates are now displayed in the settings page. However, I’m still getting # Untitled inserted at the end of the note.

Here’s the template file:

And here’s the result:

Maybe it’s coming from some other plug-in? I’m just using the core Templates plug-in.

Thanks for your kind help!

Best,
Russell

Is the title of the document ā€œUntitledā€? You can easily test this by deactivating filename-heading-sync and see if it still happens

With filename-heading-sync DEACTIVATED, and the core Templates plug-in ACTIVATED, I get a new file with ā€œUntitledā€ in the filename field, whether or not the template has an H1 heading.

With filename-heading-sync ACTIVATED, and the core Templates plug-in ACTIVATED, I get a new file with ā€œUntitledā€ in the filename field AND # Untitled inserted at the end of the file, whether or not the template has an H1 heading.

It must be something unique to my setting. I’ll keep digging around, as I have time.

Thanks,
Russell

Thank you so much!

1.6 has been released which adds a option to disable the file-open event hook. Some people were reporting issues with templater because both plugins act on file-open. Disabling file-open for those cases should hopefully fix issues