fix: handle empty markdown
All checks were successful
Deploy to SFTP Server / build (push) Successful in 10m50s
All checks were successful
Deploy to SFTP Server / build (push) Successful in 10m50s
This commit is contained in:
@@ -2,6 +2,7 @@ import MarkdownIt from "markdown-it";
|
||||
const parser = new MarkdownIt();
|
||||
|
||||
export function readDuration(markdown: string): number | undefined {
|
||||
if (!markdown) return;
|
||||
const words = markdown.split(" ")?.filter(Boolean)?.length;
|
||||
return words && Math.round(words / 250);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user