import { factorySpace } from "../micromark-factory-space/index.js";
import { markdownLineEnding, markdownSpace } from "../micromark-util-character/index.js";
function factoryWhitespace(effects, ok) {
  let seen;
  return start;
  function start(code) {
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      seen = true;
      return start;
    }
    if (markdownSpace(code)) {
      return factorySpace(effects, start, seen ? "linePrefix" : "lineSuffix")(code);
    }
    return ok(code);
  }
}
export {
  factoryWhitespace
};
//# sourceMappingURL=index.js.map
