@uiw/react-markdown-editor
Version:
A markdown editor with preview, implemented with React.js and TypeScript.
43 lines (42 loc) • 1.47 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.underline = void 0;
var _state = require("@codemirror/state");
var _jsxRuntime = require("react/jsx-runtime");
var underline = {
name: 'underline',
keyCommand: 'underline',
button: {
'aria-label': 'Add underline text'
},
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
fill: "currentColor",
viewBox: "0 0 448 512",
height: "13",
width: "13",
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M416 448H32c-17.69 0-32 14.31-32 32s14.31 32 32 32h384c17.69 0 32-14.31 32-32s-14.3-32-32-32zM48 64.01h16v160c0 88.22 71.78 159.1 160 159.1s160-71.78 160-159.1v-160h16c17.69 0 32-14.32 32-32S417.69.91 400 .91l-96-.005c-17.69 0-32 14.32-32 32s14.31 32 32 32h16v160c0 52.94-43.06 95.1-96 95.1S128 276.1 128 224V64h16c17.69 0 32-14.31 32-32S161.69 0 144 0L48 .005c-17.69 0-32 14.31-32 31.1S30.31 64.01 48 64.01z"
})
}),
execute: function execute(_ref) {
var state = _ref.state,
view = _ref.view;
if (!state || !view) return;
view.dispatch(view.state.changeByRange(function (range) {
return {
changes: [{
from: range.from,
insert: '<u>'
}, {
from: range.to,
insert: '</u>'
}],
range: _state.EditorSelection.range(range.from + 3, range.to + 3)
};
}));
}
};
exports.underline = underline;
//# sourceMappingURL=underline.js.map
;