Is there any chance an option could be added to make this work in one direction? Maybe a three-option selector:
Filename <-> Heading
Filename → Heading
Heading → Filename
My own use case is strictly that last one, where I always adjust the filename to match whatever I’ve changed the heading to, and not the other way around.
To go with this, it would be useful to have an way to set what illegal characters get replaced with in a filename - by default an empty string (“Test: Thing” becomes “Test Thing”), but some might wish to set it to “-” or other placeholders (“Test: Thing” becomes “Test- Thing”).
Useful plugin for me! Save me much time. Thanks a lot!
Is it possible to skip YAML attributes block and start searching 1-st header after the attributes block? Otherwise, it breaks the attributes.
Hi! I’m the author of that plugin but wasn’t able to reproduce your issues no matter what I tried. I still added a few changes to harden the plugin.
Do you have some steps to reproduce? Can you post a list with all plugins you have installed? It feels to me it might be an interaction between 2 things
When I add a link in a note, then I “cmd click” on this link, it creates a file with the link as filename but then the plugin doesn’t create the title . Normal?
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:
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
@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 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: