fix: handle of markdownTextTs receives null
Some checks failed
Deploy to SFTP Server / build (push) Failing after 3m7s
Some checks failed
Deploy to SFTP Server / build (push) Failing after 3m7s
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
import MarkdownIt from "markdown-it";
|
import MarkdownIt from "markdown-it";
|
||||||
const parser = new MarkdownIt();
|
const parser = new MarkdownIt();
|
||||||
|
|
||||||
export default function markdownToText(markdown: string = "<empty>"): string {
|
export default function markdownToText(markdown: string): string {
|
||||||
|
if(!markdown) return ''
|
||||||
return parser
|
return parser
|
||||||
.render(markdown)
|
.render(markdown)
|
||||||
.split("\n")
|
.split("\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user