All: Fixes #13008: Importing MD + frontmatter fails on empty variable

This commit is contained in:
Laurent Cozic committed 2025-12-12 11:53:03 +00:00
1 parent 7dae90c9f3
commit d551963669
4 files changed
+22 -3

No files matched your search

+4 -2
View File
@@ -240,8 +240,10 @@ export const parse = (note: string): ParsedMeta => {
if ('tags' in md) {
// Only create unique tags
tags = md['tags'];
} else if ('keywords' in md) {
// Adding support for r-markdown/pandoc
} else if ('keywords' in md && Array.isArray(md.keywords)) {
// Support for r-markdown/pandoc. Note that "keywords" may be an empty field in the input
// document, which would be parsed as just "null", so this is why we need to check that it
// is an array. Fixes: https://github.com/laurent22/joplin/issues/13008
tags = tags.concat(md['keywords']);
}