Skip to content

Commit

Permalink
Update template.ts - trim extra spaces
Browse files Browse the repository at this point in the history
datePublished and dateRead have an extra space after the actual date. In Obsidian this breaks creating dates in the template:

`> date read: [[{{{dateRead}}}]]`

turns into:
`> date read: [[2023-01-01 ]]`
  • Loading branch information
QWxleA authored Jun 17, 2023
1 parent 38c00df commit 9d29a0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/settings/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ export const renderArticleContnet = async (
article.siteName || siteNameFromUrl(article.originalArticleUrl);
const publishedAt = article.publishedAt;
const datePublished = publishedAt
? formatDate(publishedAt, dateSavedFormat)
? formatDate(publishedAt, dateSavedFormat).trim()
: undefined;
const articleNote = article.highlights?.find(
(h) => h.type === HighlightType.Note
);
const dateRead = article.readAt
? formatDate(article.readAt, dateSavedFormat)
? formatDate(article.readAt, dateSavedFormat).trim()
: undefined;
const wordsCount = article.wordsCount;
const readLength = wordsCount
Expand Down

0 comments on commit 9d29a0d

Please sign in to comment.