What markdown syntax costs
Heading hashes, emphasis asterisks, list bullets and link URLs all consume tokens. A link in particular is expensive: the visible text is what carries meaning, and the URL beside it is frequently thirty tokens of characters the model will never usefully act on.
On a documentation corpus fed into retrieval, stripping syntax typically removes ten to twenty percent of the tokens with no loss of information the model uses.
What to keep
Keep list markers when the sequence matters — steps in a procedure, ranked options. The bullet is cheap and the structure genuinely aids comprehension.
Keep code blocks when the code is the subject. Strip them when you are feeding prose documentation and the examples are incidental, because code is token-dense and dilutes retrieval.
Keep link text almost always. Drop the URLs almost always. The exception is when you want the model to cite sources back to the user.
The case for keeping some structure
There is a real tension here. Headings are cheap and they help a model locate information in a long document, which is why removing them wholesale is not automatically right.
A reasonable compromise for retrieval pipelines is to strip inline syntax aggressively while keeping heading text as a plain line — you lose the hashes and keep the signposting.