segmentio/metalsmith-excerpts — pull request #7 by mattwidmann (2014-05-05 21:23:16+00:00)
Title: Fix reference-style links in first paragraph

This fixes issue #5.

Instead of finding the first paragraph from the Markdown source, convert it to HTML and then find the first `

` tag using cheerio. Two new tests are also included to ensure reference-style links are converted to anchor tags correctly and to ensure that the excerpt is the first Markdown paragraph, not a code block.

Also, whitespace is now trimmed from excerpts before adding them to a file.