A simple hack using clang-format:
Install clang-format(if not already installed)
sudo apt-get install clang-format
Generate clang-format file(if not already present)
clang-format -style=llvm -dump-config > .clang-format
Copy contents of .md file and paste it in a new file, save this newly created file with extension .cpp. Mark pasted content of .md file as a C++ comment by encapsulating it with /* and */
Use created clang-format file as,
clang-format -i foo.cpp
where foo is the name of saved C++ file.
You can now uncomment contents of original .md file and use it.
Note:
This works due to the following property of clang-format file
ColumnLimit: 80