Bugfix/remove invalid markdown (#3219)

remove invalid markdown
This commit is contained in:
Henry Heng
2024-09-19 14:56:13 +01:00
committed by GitHub
parent a2911d2aaf
commit 1219c2ff12
3 changed files with 10 additions and 5 deletions
+5
View File
@@ -926,3 +926,8 @@ export const mapMimeTypeToExt = (mimeType: string) => {
return ''
}
}
// remove invalid markdown image pattern: ![<some-string>](<some-string>)
export const removeInvalidImageMarkdown = (output: string): string => {
return typeof output === 'string' ? output.replace(/!\[.*?\]\((?!https?:\/\/).*?\)/g, '') : output
}