UNPKG

mathup

Version:

Easy MathML authoring tool with a quick to write syntax

23 lines (19 loc) 401 B
/** @type {import("./index.js").Scanner} */ export default function newlineScanner(char, input, { start, grouping }) { if (char !== "\n") { return null; } let i = start; let nextChar = char; let value = ""; while (nextChar === "\n") { value += nextChar; i += 1; nextChar = input[i]; } return { type: grouping ? "sep.row" : "space", value, end: i, }; }