mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-15 02:43:20 +08:00
fix: preserve content after frontmatter in parse_instinct_file() (#161)
parse_instinct_file() was appending the instinct and resetting state when frontmatter ended (second ---), before any content lines could be collected. This caused all content (Action, Evidence, Examples) to be lost during import. Fix: only set in_frontmatter=False when frontmatter ends. The existing logic at the start of next frontmatter (or EOF) correctly appends the instinct with its collected content. Fixes #148
This commit is contained in:
@@ -50,13 +50,8 @@ def parse_instinct_file(content: str) -> list[dict]:
|
||||
for line in content.split('\n'):
|
||||
if line.strip() == '---':
|
||||
if in_frontmatter:
|
||||
# End of frontmatter
|
||||
# End of frontmatter - content comes next, don't append yet
|
||||
in_frontmatter = False
|
||||
if current:
|
||||
current['content'] = '\n'.join(content_lines).strip()
|
||||
instincts.append(current)
|
||||
current = {}
|
||||
content_lines = []
|
||||
else:
|
||||
# Start of frontmatter
|
||||
in_frontmatter = True
|
||||
|
||||
Reference in New Issue
Block a user