Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix(parse): honor markdown frontmatter config (#3475)

Wu JiaCheng62a913795cd4
diff --git a/openviking/parse/parsers/markdown.py b/openviking/parse/parsers/markdown.py
index 1b9a7ee3e..206cf286b 100644
--- a/openviking/parse/parsers/markdown.py
+++ b/openviking/parse/parsers/markdown.py
@@ -155,18 +155,20 @@ class MarkdownParser(BaseParser):
def __init__(
self,
- extract_frontmatter: bool = True,
+ extract_frontmatter: Optional[bool] = None,
config: Optional[ParserConfig] = None,
):
"""
Initialize the enhanced markdown parser.
Args:
- extract_frontmatter: Whether to extract YAML frontmatter
+ extract_frontmatter: Whether to extract YAML frontmatter. When None, uses config.
config: Parser configuration (uses default if None)
"""
- self.extract_frontmatter = extract_frontmatter
self.config = config or ParserConfig()
+ if extract_frontmatter is None:
+ extract_frontmatter = getattr(self.config, "extract_frontmatter", True)
+ self.extract_frontmatter = extract_frontmatter
# Compile regex patterns for better performance
self._heading_pattern = re.compile(r"^(#{1,6})\s+(.+)$", re.MULTILINE)