Skip to content

Commit 371184f

Browse files
committed
fix: replace '?' in file names with empty string
It's only supported on Linux and MacOS, and from a quick look, there isn't a nice way to differentiate between the desktop OS the user is on. So just removing `?` seems to be fine. Another reason is that the `?` create other issues on Unix systems due to `?` operating as a wildcard operator. If anyone is dissatisfied with this change, I'll look into alternative solutions.
1 parent 27bdd6e commit 371184f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/TemplateEngine.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function NoteTemplateEngine(template: string, episode: Episode) {
7878
// reduce multiple new lines
7979
const sanitizeDescription = htmlToMarkdown(episode.description).replace(
8080
/\n{3,}/g,
81-
"\n\n"
81+
"\n\n",
8282
);
8383
if (prependToLines) {
8484
return sanitizeDescription
@@ -108,7 +108,7 @@ export function NoteTemplateEngine(template: string, episode: Episode) {
108108
);
109109
addTag(
110110
"podcast",
111-
replaceIllegalFileNameCharactersInString(episode.podcastName)
111+
replaceIllegalFileNameCharactersInString(episode.podcastName),
112112
);
113113
addTag("artwork", episode.artworkUrl ?? "");
114114

@@ -241,7 +241,7 @@ export function TranscriptTemplateEngine(
241241

242242
function replaceIllegalFileNameCharactersInString(string: string) {
243243
return string
244-
.replace(/[\\,#%&{}/*<>$'":@\u2023|\\.]/g, "") // Replace illegal file name characters with empty string
244+
.replace(/[\\,#%&{}/*<>$'":@\u2023|\\.\?]/g, "") // Replace illegal file name characters with empty string
245245
.replace(/\n/, " ") // replace newlines with spaces
246246
.replace(" ", " "); // replace multiple spaces with single space to make sure we don't have double spaces in the file name
247-
}
247+
}

0 commit comments

Comments
 (0)