Add fallback parser for markdown files with invalid YAML frontmatter to prevent indexing failures
This commit is contained in:
+2
-1
@@ -16,6 +16,7 @@ from backend.indexer import (
|
||||
index,
|
||||
get_vault_data,
|
||||
find_file_in_index,
|
||||
parse_markdown_file,
|
||||
SUPPORTED_EXTENSIONS,
|
||||
)
|
||||
from backend.search import search, get_all_tags
|
||||
@@ -211,7 +212,7 @@ async def api_file(vault_name: str, path: str = Query(..., description="Relative
|
||||
ext = file_path.suffix.lower()
|
||||
|
||||
if ext == ".md":
|
||||
post = frontmatter.loads(raw)
|
||||
post = parse_markdown_file(raw)
|
||||
|
||||
# Extract metadata
|
||||
tags = post.metadata.get("tags", [])
|
||||
|
||||
Reference in New Issue
Block a user