franciskafieh / obsidian-list-modified

🪨 The advanced and adaptive changelog for Obsidian. Links all modified files meeting certain criteria to a timed (daily, weekly, monthly) note.
MIT License
85 stars 7 forks source link

Remove comma at the end when checking ignore #92

Closed Benature closed 1 week ago

Benature commented 4 months ago

Thanks for the great plugin!

One time I added a comma accidentally and found it failed to track files' modification, as there is an empty string "" in excludedFolderPaths. Therefore, I add the code to remove the comma at the end for folder/tag/text.

franciskafieh commented 2 months ago

Thank you for this. Sorry for the long wait. This looks good, but I am going to merge this into the dev branch "jest" (where I am adding unit tests and refactoring the plugin) once that is complete. I have been busy lately so I am not sure when this would be completed

franciskafieh commented 1 week ago

Thank you again. For the sake of recognizing your contribution, I have merged this into master.

After your bug find, I have realized that the regex used is unintuitive and difficult to maintain. Instead, the rewrite now uses plain JS functions. See https://github.com/franciskafieh/obsidian-list-modified/blob/jest/src/utils/converCommaListToArray.ts and its related passing test https://github.com/franciskafieh/obsidian-list-modified/blob/jest/tests/utils/convertCommaListToArray.test.ts