sentences-per-line
Utility functions to enforce the number of sentences per line in Markdown files. 📐
Usage
Looking for the ESLint, Markdownlint, or Prettier plugins to enforce sentences-per-line? See ../../README.md > ## Packages.
npm i sentences-per-linegetIndexBeforeSecondSentence
Retrieves the first index after the period of the line's first sentence, if a second sentence follows it. This is the driving function behind enforcing one sentence per line in the sentences-per-line monorepo's packages.
import { getIndexBeforeSecondSentence } from "sentences-per-line";
// undefined
getIndexBeforeSecondSentence("The only sentence.");
// 15
getIndexBeforeSecondSentence("First sentence. Second sentence.");