Expand description
Markdown text processing utilities.
Ported from files.md (server/txt/mod.rs) by Artem Zakirullin.
Provides string similarity, link extraction, and text normalization.
Constants§
- MIN_
SEARCH_ SIMILARITY - Minimum similarity score (0-100) for fuzzy name search.
Functions§
- emoji_
prefix - Add emoji prefix to string, stripping known prefixes first.
- extract_
headings - Extract all headings (
## Title) from content. - extract_
markdown_ links - Extract all markdown links
[text](path)from content. - first_
word - Get the first word from a string.
- has_
image - Check if text contains a markdown image.
- is_
multiline - Check if text has multiple lines.
- lcfirst
- First character lowercase (Unicode-aware).
- levenshtein
- Compute Levenshtein edit distance between two strings.
- norm_
new_ lines - Normalize CRLF and CR to LF.
- similar
- Calculate similarity between two strings (0.0 – 100.0) using Levenshtein distance.
- split_
text_ into_ chunks - Split text into chunks of at most
max_lencharacters. - strip_
chat_ timestamp - Strip a leading
`HH:MM`timestamp from chat entries. - substr
- Unicode-safe substring.
- today_
chat_ header - 오늘 날짜의 Chat.md 헤더 문자열 (예: “#### 20 May, Tuesday”).
- today_
journal_ path - 오늘 날짜의 저널 파일 경로 (예: “journal/2026.05 May.md”).
- truncate
- Truncate a string to
max_len, appending “…” if truncated. - ucfirst
- First character uppercase (Unicode-aware).