@atlaskit/renderer
Version:
Renderer component
15 lines • 800 B
JavaScript
import React from 'react';
var HardBreak = function HardBreak(_ref) {
var _ref$forceNewLine = _ref.forceNewLine,
forceNewLine = _ref$forceNewLine === void 0 ? false : _ref$forceNewLine;
// To display an empty line using Shift+Enter, ProseMirror inserts a
// double <br>. The second <br> is not part of the document, it's just
// there to make browsers behave properly. The forceNewLine prop in this
// component replicates this behaviour. If the last child node is a
// hardBreak, it will also insert a double <br>.
if (forceNewLine) {
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null));
}
return /*#__PURE__*/React.createElement("br", null);
};
export default HardBreak;