MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / _extract_wikilinks

Function _extract_wikilinks

openkb/lint.py:154–160  ·  view source on GitHub ↗

Return all wikilink targets found in *text*. Handles ``[[target|display text]]`` alias syntax — only the target is returned.

(text: str)

Source from the content-addressed store, hash-verified

152
153
154def _extract_wikilinks(text: str) -> list[str]:
155 """Return all wikilink targets found in *text*.
156
157 Handles ``[[target|display text]]`` alias syntax — only the target is returned.
158 """
159 raw = _WIKILINK_RE.findall(text)
160 return [link.split("|")[0].strip() for link in raw]
161
162
163def list_existing_wiki_targets(wiki_dir: Path) -> set[str]:

Callers 4

build_graphFunction · 0.90
find_broken_linksFunction · 0.85
find_orphansFunction · 0.85
check_index_syncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected