remove tags from article header (#6)
This commit is contained in:
parent
01f721f938
commit
4487fb0945
14 changed files with 50 additions and 68 deletions
|
@ -10,7 +10,7 @@ export function readingTime(html: string) {
|
|||
const textOnly = html.replace(/<[^>]+>/g, "");
|
||||
const wordCount = textOnly.split(/\s+/).length;
|
||||
const readingTimeMinutes = (wordCount / 200 + 1).toFixed();
|
||||
return `${wordCount} words (~${readingTimeMinutes} min read)`;
|
||||
return `${wordCount} words (${readingTimeMinutes} mins)`;
|
||||
}
|
||||
|
||||
export function dateRange(startDate: Date, endDate?: Date | string): string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue