I'm interested in storing, say, wiki pages as flat files that can be
edited with Vim or Emacs and also processed with line-based unix text
tools and version control systems like Git. All these tools work much
better with linebreaks after every line of text. For example, diffs
are much easier to deal with when a text file has line breaks after
every line of text.

But it's awkward to edit these same files through a textarea on a
webpage with all the line breaks. Is there a good Ruby tool or script
that can convert a text file written in, say Markdown or Asciidoc,
into a version that removes the line breaks for editing in a browser
textarea and then reinserts them on the update?

The problem is complicated a bit by the fact that you might want to
preserve line breaks in some parts of a Markdown or Asciidoc document,
like where you have a bulleted list. But you would want to wrap and
unwrap flowing text in a paragraph or in an item of a list.