@atlaskit/editor-wikimarkup-transformer
Version:
Wiki markup transformer for JIRA and Confluence
26 lines • 811 B
JavaScript
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import { rawContentProcessor } from './quote-macro';
// bq. foobarbaz
// Ignored via go/ees005
// eslint-disable-next-line require-unicode-regexp
var BLOCKQUOTE_REGEXP = /^bq\.(.*)/;
export var blockquote = function blockquote(_ref) {
var input = _ref.input,
position = _ref.position,
schema = _ref.schema,
context = _ref.context;
var match = input.substring(position).match(BLOCKQUOTE_REGEXP);
if (!match) {
return fallback(input, position);
}
var _match = _slicedToArray(match, 2),
rawContent = _match[1];
return rawContentProcessor('', rawContent, match[0].length, schema, context);
};
function fallback(input, position) {
return {
type: 'text',
text: input.substr(position, 1),
length: 1
};
}