Headings are free metadata
Markdown and HTML carry hierarchy that a generic splitter throws away. A structure-aware splitter walks the heading tree and keeps the parent-heading path attached to every chunk. Now your retrieval result is not just "...the deployment workflow..." — it is "Operations > Deploy > Production rollback — the deployment workflow...". The model gets context for free, and you get a citation breadcrumb.
Code splitting is a different problem
Plain text splitters break Python halfway through a function and Rust halfway through a generic. Use a language-aware splitter (LangChain's Language.PYTHON, tree-sitter, or AST-based) so a chunk is always a coherent function, class, or top-level statement. Search relevance jumps immediately.