parseDocumentation retains hard line breaks and removes soft line breaks inside documentation comments.
Wether a line break is hard or soft is determined by the following rules (some of which have been discussed in https://github.com/clangd/clangd/issues/95):
- Hard Markdown line breaks (https://github.github.com/gfm/#hard-line-breaks) are retained
- Line breaks that are preceded by a punctuation are retained
- Line breaks that are followed by "interesting characters" (e.g. Markdown syntax, doxygen commands) are retained
- All other line breaks are removed
Since this is my first contribution feel free to be extra thorough.
Related issue: https://github.com/clangd/clangd/issues/95
I think we're going to end up using this elsewhere, e.g. in code completion.
Fine to keep it in Hover for now, but please expose it from hover.h and test it directly (rather than via HoverInfo::present())
This will also allow moving this implementation to the end of the file, rather than interleaving it with unrelated parts of hover logic.