This commit is contained in:
Oscar Plaisant
2024-05-23 13:17:37 +02:00
parent de3a0dcf0f
commit bff6dbf1e5
55 changed files with 28434 additions and 71577 deletions

View File

@@ -4208,10 +4208,11 @@ function NoteTemplateEngine(template, episode) {
const [replacer, addTag] = useTemplateEngine();
addTag("title", episode.title);
addTag("description", (prependToLines) => {
const sanitizeDescription = (0, import_obsidian9.htmlToMarkdown)(episode.description).replace(/\n{3,}/g, "\n\n");
if (prependToLines) {
return (0, import_obsidian9.htmlToMarkdown)(episode.description).split("\n").map((str) => `${prependToLines}${str}`).join("\n");
return sanitizeDescription.split("\n").map((str) => `${prependToLines}${str}`).join("\n");
}
return (0, import_obsidian9.htmlToMarkdown)(episode.description);
return sanitizeDescription;
});
addTag("content", (prependToLines) => {
if (prependToLines) {
@@ -4222,7 +4223,7 @@ function NoteTemplateEngine(template, episode) {
addTag("safetitle", replaceIllegalFileNameCharactersInString(episode.title));
addTag("url", episode.url);
addTag("date", (format2) => episode.episodeDate ? window.moment(episode.episodeDate).format(format2 != null ? format2 : "YYYY-MM-DD") : "");
addTag("podcast", episode.podcastName);
addTag("podcast", replaceIllegalFileNameCharactersInString(episode.podcastName));
addTag("artwork", (_a = episode.artworkUrl) != null ? _a : "");
return replacer(template);
}
@@ -4273,7 +4274,7 @@ function DownloadPathTemplateEngine(template, episode) {
return replacer(templateWithoutExtension);
}
function replaceIllegalFileNameCharactersInString(string) {
return string.replace(/[\\,#%&{}/*<>$'":@\u2023|?]*/g, "").replace(/\n/, " ").replace(" ", " ");
return string.replace(/[\\,#%&{}/*<>$'":@\u2023|\\.]/g, "").replace(/\n/, " ").replace(" ", " ");
}
// src/opml.ts

View File

@@ -1,7 +1,7 @@
{
"id": "podnotes",
"name": "PodNotes",
"version": "2.11.1",
"version": "2.11.2",
"minAppVersion": "0.15.9",
"description": "Helps you write notes on podcasts.",
"author": "Christian B. B. Houmann",