UNPKG

@atlaskit/editor-wikimarkup-transformer

Version:

Wiki markup transformer for JIRA and Confluence

27 lines (26 loc) 741 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.quadrupleDashSymbol = void 0; // Ignored via go/ees005 // eslint-disable-next-line require-unicode-regexp var MULTI_DASH_REGEX = /^-{4,}(\s|$)/; var quadrupleDashSymbol = exports.quadrupleDashSymbol = function quadrupleDashSymbol(_ref) { var input = _ref.input, position = _ref.position; // This won't be a ruler because ruler has been checked at leadingKeywordMapping var match = input.substring(position).match(MULTI_DASH_REGEX); if (!match) { return { type: 'text', text: '----', length: 4 }; } return { type: 'text', text: input.substr(position, match[0].length), length: match[0].length }; };