/** * @author Titus Wormer * @copyright 2015 Titus Wormer * @license MIT * @module remark:parse:locate:break * @fileoverview Locate a break. */ 'use strict'; module.exports = locate; function locate(value, fromIndex) { var index = value.indexOf('\n', fromIndex); while (index > fromIndex) { if (value.charAt(index - 1) !== ' ') { break; } index--; } return index; }