---
title: Unwrap Paragraphs for the Markdown Service Tools
date: 2012-02-14 09:38
slug: unwrap-paragraphs-for-the-markdown-service-tools
categories:
- Code
tags:
- markdown
- markdownservices
- service
---

[twitter]: https://twitter.com/lucianofuentes/status/169379718062288896
[mdst]: http://brettterpstra.com/project/markdown-service-tools/

Inspired by a Twitter request this morning, I've updated the Markdown Service Tools to version 1.3.1 to include an experimental version of a new service: Unwrap Paragraphs.

Opposite from the "Preserve line breaks" service, this one will look for consecutive lines and merge them together into one paragraph. It handles hyphenated words and won't mess up em/en dashes in Markdown style (`--` or `---`). If there's a newline between two lines, it assumes it's a new paragraph and treats it as such.

**Note:** this *does* currently unwrap list items and code blocks as well. It should be used selectively on paragraph text. I'll eventually put in the time to come up with a regular expression that will avoid this.

Version 1.3.1 is available on the [Markdown Service Tools project page][mdst]. Somebody [owes me a box of Aussie Tim Tams][twitter].

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
