Recurring #TechWriting issue that I still haven't found a good solution for:

Is anyone aware of a decently reliable automation for reformatting #Markdown text that previously used line length limits of 80 characters and forced line wraps, to one sentence per line?

Must preserve all Markdown formatting including tables and fenced code blocks.

(If you think this is trivial and can be solved with a sprinkling of regex — nope.)

Boosts appreciated!

@xahteiwi emacs's markdown-mode partially renders markdown so pesky in-sentence markups are gone... then setting a high enough fill-width unbreaks the paragraph into a single wrapped line. then select the line, replace ". " to ". LF" and you would have the desired formatting. record a macro of the above and repeat over the paragraphs until done. tried it in a small doc and it seemed to work mostly... code, lists, quote blocks are all skipped properly... because the markdown-mode doesn't render tables, those need to be skipped manually. of course if you don't use emacs, you now have two problems :) (apologies to jwz).
@xahteiwi mark-end-of-sentence lets you hop by sentences so it is safer than blindly replacing ". ".
@kaveman Right; your suggestion is essentially a variant of https://hachyderm.io/@OmegaPolice/114557428773845306 — see my reply there. :)
Raphael (@OmegaPolice@hachyderm.io)

@xahteiwi@mastodon.social Best guess: Convert to HTML and back. Identifying sentences remains a hard problem, but the rest should be mostly mechanical. I'd start with Pandoc, hoping that it can be configured to create Markdown in the required format.

Hachyderm.io