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:
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:
But itās still putting #Untitled at the end of the files.
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.
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
Obsidian shows the file name above the current pane since 1.0. Depends on what you want - do you want the heading as part of the markdown document or are you okay with the obsidian display?
For myself, I turned off the Obsidian feature because I want all the information semantically in my files