@uiw/react-markdown-editor
Version:
A markdown editor with preview, implemented with React.js and TypeScript.
43 lines (42 loc) • 1.4 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.italic = void 0;
var _state = require("@codemirror/state");
var _jsxRuntime = require("react/jsx-runtime");
var italic = {
name: 'italic',
keyCommand: 'italic',
button: {
'aria-label': 'Add italic text'
},
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
width: "13",
height: "13",
viewBox: "0 0 320 512",
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
fill: "currentColor",
d: "M204.758 416h-33.849l62.092-320h40.725a16 16 0 0 0 15.704-12.937l6.242-32C297.599 41.184 290.034 32 279.968 32H120.235a16 16 0 0 0-15.704 12.937l-6.242 32C96.362 86.816 103.927 96 113.993 96h33.846l-62.09 320H46.278a16 16 0 0 0-15.704 12.935l-6.245 32C22.402 470.815 29.967 480 40.034 480h158.479a16 16 0 0 0 15.704-12.935l6.245-32c1.927-9.88-5.638-19.065-15.704-19.065z"
})
}),
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: '*'
}, {
from: range.to,
insert: '*'
}],
range: _state.EditorSelection.range(range.from + 1, range.to + 1)
};
}));
}
};
exports.italic = italic;
//# sourceMappingURL=italic.js.map
;