Skip to content

Commit

Permalink
Remove illegal characters for folder names too (#211)
Browse files Browse the repository at this point in the history
At the moment, we remove illegal characters for file names but not folder names. This diff adds it.
  • Loading branch information
lestertay authored Mar 25, 2024
1 parent dec1418 commit 495ec9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ export default class OmnivorePlugin extends Plugin {
)

for (const item of items) {
const folderName = normalizePath(
render(item, folder, this.settings.folderDateFormat),
const folderName = replaceIllegalChars(
normalizePath(

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18.x)

Replace `␍⏎··············render(item,·folder,·this.settings.folderDateFormat),␍⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20.x)

Replace `␍⏎··············render(item,·folder,·this.settings.folderDateFormat),␍⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18.x)

Replace `⏎··············render(item,·folder,·this.settings.folderDateFormat),⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18.x)

Replace `␍⏎··············render(item,·folder,·this.settings.folderDateFormat),␍⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`

Check failure on line 257 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20.x)

Replace `␍⏎··············render(item,·folder,·this.settings.folderDateFormat),␍⏎············)` with `render(item,·folder,·this.settings.folderDateFormat)),`
render(item, folder, this.settings.folderDateFormat),
)
)
const omnivoreFolder =
this.app.vault.getAbstractFileByPath(folderName)
Expand Down

0 comments on commit 495ec9c

Please sign in to comment.