From 07ec52e4dcfac2d7d80c31856aa62c9847ed1289 Mon Sep 17 00:00:00 2001 From: Arkadiusz Wieczorek Date: Sun, 17 Jul 2022 11:09:35 +0200 Subject: [PATCH] Fix validator issue for itunes.subtitle --- .editorconfig | 3 +++ index.ts | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d1169ef --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +indent_style = space +indent_size = 4 \ No newline at end of file diff --git a/index.ts b/index.ts index 7769f45..053f909 100644 --- a/index.ts +++ b/index.ts @@ -17,18 +17,17 @@ app.use(async (ctx) => { "kontakt@midline.pl"; parsed_data.rss.channel[0]["itunes:owner"][0]["itunes:name"] = "Arkadiusz Wieczorek, Kuba Orlik"; - parsed_data.rss.channel[0]["link"] = "https://www.internet-czas-dzialac.pl"; - parsed_data.rss.channel[0][ - "itunes:keywords" - ][0] = parsed_data.rss.channel[0]["itunes:keywords"][0] - .split(" ") - .toString(); - parsed_data.rss.channel[0][ - "itunes:summary" - ][0] = parsed_data.rss.channel[0]["itunes:summary"][0].replace( - /(<([^>]+)>)/gi, - "" - ); + parsed_data.rss.channel[0]["link"] = + "https://www.internet-czas-dzialac.pl"; + parsed_data.rss.channel[0]["itunes:keywords"][0] = + parsed_data.rss.channel[0]["itunes:keywords"][0] + .split(" ") + .toString(); + parsed_data.rss.channel[0]["itunes:summary"][0] = + parsed_data.rss.channel[0]["itunes:summary"][0].replace( + /(<([^>]+)>)/gi, + "" + ); for ( let i = 0; @@ -49,7 +48,7 @@ app.use(async (ctx) => { item["guid"][0].$.isPermaLink = item["guid"][0].$.isPermalink; delete item["guid"][0].$.isPermalink; item["itunes:subtitle"][0] = - item["itunes:subtitle"][0].slice(0, -2) + "…"; + item["itunes:subtitle"][0].split(".")[0] + "."; item["itunes:summary"][0] = item["itunes:summary"][0].replace( /(<([^>]+)>)/gi, ""