from PyQt6.QtCore import Qt
from pathlib import Path
from core.models import Article, ARTICLE_TYPES
-from core.frontmatter import write_frontmatter
+from core.frontmatter import parse_frontmatter, write_frontmatter
from core.taxonomy import load_taxonomy
class MultiTokenCompleter(QCompleter):
else:
updated[key] = val
try:
- write_frontmatter(self._article.path, updated, "")
+ _, body = parse_frontmatter(self._article.path)
+ write_frontmatter(self._article.path, updated, body)
self._article.frontmatter.update(updated)
self.accept()
except Exception as e: