Skip to content

Commit

Permalink
Added additional replacements for illegal characters #28
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiGasai committed Nov 29, 2022
1 parent eea245b commit 06d6a74
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "google-calendar",
"name": "Google Calendar",
"version": "1.6.13",
"version": "1.6.14",
"minAppVersion": "0.12.0",
"description": "Interact with your Google Calendar from Inside Obsidian",
"author": "YukiGasai",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "google-calendar",
"version": "1.6.13",
"version": "1.6.14",
"description": "Interact with your Google Calendar from Inside Obsidian",
"main": "main.js",
"scripts": {
Expand Down
13 changes: 12 additions & 1 deletion src/helper/AutoEventNoteCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,18 @@ export const createNoteFromEvent = async (event: GoogleEvent, folderName?:string
folderPath = folderName;
}
}
let cleanEventSummary = event.summary.replace('/', '-').replace(':', '-').replace('\\', '-');
let cleanEventSummary = event.summary
.trim()
.replace('<', 'lt')
.replace('>', 'gt')
.replace('\"', '\'\'')
.replace('\\', '-')
.replace('/', '-')
.replace(':', '-')
.replace('|', '-')
.replace('*', '')
.replace('?', '');

const filePath = normalizePath(`${folderPath}/${cleanEventSummary}.md`);

//check if file already exists
Expand Down

0 comments on commit 06d6a74

Please sign in to comment.