UNPKG

@carrotsearch/gatsby-transformer-html

Version:

A Gatsby transformer plugin for authoring content in HTML. Supports ToC generation, responsive images, section anchors and HighlightJS code highlighting.

7 lines (6 loc) 150 B
exports.removeLeadingAndTrailingNewlines = content => { if (!content) { return ""; } return content.replace(/^(\r?\n)*|(\r?\n)*$/g, ""); };