mirror of
https://github.com/Ar9av/obsidian-wiki.git
synced 2026-09-14 20:36:34 +08:00
81b18b649e
classify_query() strips punctuation on the direct path but not on the gap and list paths, where both end in .strip().split() -- and .strip() without arguments removes only whitespace. "What do I know about mise?" therefore yields the term "mise?", which matches no title, tag or summary, so the query returns nothing even when the page exists. Dropping the question mark makes the same query work, which is how the asymmetry surfaced. Both paths now go through a shared _split_terms() helper that splits on whitespace and strips the same punctuation set the direct path already used, now named _TERM_PUNCT. The direct path keeps its behaviour unchanged: its len(w) > 2 guard still applies to the unstripped token, so only the inline literal is replaced by the constant. Gap queries nearly always end in a question mark, so this path was broken for its ordinary input. Three regression tests cover the gap path, the list path, and agreement between the gap and direct paths on the same subject. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
17 KiB
17 KiB