note-refactor-obsidian icon indicating copy to clipboard operation
note-refactor-obsidian copied to clipboard

Refactoring with Headers behaves unexpectedly.

Open dummifiedme opened this issue 5 years ago • 3 comments

Tried refactoring based on H3, then inside that note, tried the same, and it created the links for a second and just replaces the whole content back in the file. So, I did it again for like 3-4 times, same thing kept happening. I think it was due to --- in my text. When I removed --- lines from my text, they for refactored. But there was another catch.

Guess what? Now all the files (refactored notes), now have repeated contents!! 3-4 times the same stuff. Somenotes were ling enough. Its been quite sometime, and I am still landing on pages with such repetitions. Complete mess :)

Please look into the error. I don't really know how to reproduce it exactly. But strong feeling about the --- thing.

dummifiedme avatar Dec 21 '20 09:12 dummifiedme

So, you ran the command to refactor a note by H3 and then ran the same command on the same note a second time? That shouldn't do anything as there are no other H3's to extract.

I've done some testing with --- included in refactored note content without any issues. Are you able to share examples of the notes you were using? I can then try and recreate your issue with the same content you were using.

lynchjames avatar Dec 23 '20 21:12 lynchjames

As for the H3 in the new notes, ofcourse I made them available after replacing all the H4 with H3 and then ran the command 😅.

I suspected --- since it is the only thing that existed visibly different other than other notes that I had refactored till now.

I try to see if I can reproduce with an example and get back to you.

dummifiedme avatar Dec 23 '20 23:12 dummifiedme

I had issues with files where there's multiple H3 and H4 below them (and I tried using this plugin to refactor all H3 headers.)

The H3-only sections where refactored correctly while others with H4 below it where skipped (in some cases, the new files were created correctly with contents, but the original parts in the original file were not replaced with a link).

mkasu avatar Jan 18 '21 04:01 mkasu