UNPKG

@atlaskit/editor-wikimarkup-transformer

Version:

Wiki markup transformer for JIRA and Confluence

27 lines (26 loc) 677 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hardbreak = void 0; var _whitespace = require("./whitespace"); var hardbreak = exports.hardbreak = function hardbreak(_ref) { var input = _ref.input, position = _ref.position, schema = _ref.schema; // Look for normal hardbreak \r, \n, \r\n var length = (0, _whitespace.parseNewlineOnly)(input.substring(position)); if (length === 0) { // not a valid hardbreak return { type: 'text', text: input.substr(position, 1), length: 1 }; } return { type: 'pmnode', nodes: [schema.nodes.hardBreak.createChecked()], length: length }; };