Skip to content

Commit bd5f2fb

Browse files
committed
fix: sanitize concept name in _gen_update and correct _update_index docstring
1 parent 563ea9c commit bd5f2fb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

openkb/agent/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def _update_index(
468468
469469
When ``doc_brief`` or entries in ``concept_briefs`` are provided, entries
470470
are written as ``- [[link]] (type) — brief text``. Existing entries are
471-
detected by the link part only, so updating a brief on a re-compile works.
471+
detected by the link part only and skipped to avoid duplicates.
472472
``doc_type`` is ``"short"`` or ``"pageindex"`` — shown in the entry so the
473473
query agent knows how to access detailed content.
474474
"""
@@ -595,7 +595,7 @@ async def _gen_create(concept: dict) -> tuple[str, str, bool, str]:
595595
async def _gen_update(concept: dict) -> tuple[str, str, bool, str]:
596596
name = concept["name"]
597597
title = concept.get("title", name)
598-
concept_path = wiki_dir / "concepts" / f"{name}.md"
598+
concept_path = wiki_dir / "concepts" / f"{_sanitize_concept_name(name)}.md"
599599
if concept_path.exists():
600600
raw_text = concept_path.read_text(encoding="utf-8")
601601
if raw_text.startswith("---"):

0 commit comments

Comments
 (0)