pub fn to_plain_text(markdown: &str) -> StringExpand description
Extract plain text from markdown content.
Strips all markdown syntax, returning only text that would be visible when rendered. This is useful for:
- Search indexing: Index only searchable text
- Accessibility: Screen reader text extraction
- Word counts: Accurate content word counts
- Diffs: Compare semantic content, not syntax
§Elements stripped
| Markdown | Plain Text |
|---|---|
[text](url) | text |
 | alt |
[[Page]] | Page |
[[Page|Display]] | Display |
**bold** | bold |
*italic* | italic |
`code` | code |
~~strike~~ | strike |
# Heading | Heading |
> quote | (quote content) |
| Code fences | (content preserved) |
§Example
use turbovault_parser::to_plain_text;
let plain = to_plain_text("[Overview](#overview) and **bold**");
assert_eq!(plain, "Overview and bold");
// Wikilinks are handled properly
let plain = to_plain_text("See [[Note]] and [[Other|display]]");
assert_eq!(plain, "See Note and display");